Fixes BadgeReg Middleware (#4547) (#4556)

This commit is contained in:
Nicolas Gotchac 2017-02-15 13:42:55 +01:00 committed by Jaco Greeff
parent 8aaa18d75d
commit 4bae2c751c

View File

@ -87,12 +87,12 @@ export default class CertificationsMiddleware {
badgeReg badgeReg
.getContract() .getContract()
.then((badgeRegContract) => { .then((badgeRegContract) => {
return badgeRegUpdateFilter(badgeRegContract.address, [ return badgeRegUpdateFilter(badgeRegContract.address, [ [
badgeRegContract.instance.Registered.signature, badgeRegContract.instance.Registered.signature,
badgeRegContract.instance.Unregistered.signature, badgeRegContract.instance.Unregistered.signature,
badgeRegContract.instance.MetaChanged.signature, badgeRegContract.instance.MetaChanged.signature,
badgeRegContract.instance.AddressChanged.signature badgeRegContract.instance.AddressChanged.signature
]); ] ]);
}) })
.then(() => { .then(() => {
shortFetchChanges(); shortFetchChanges();
@ -125,9 +125,13 @@ export default class CertificationsMiddleware {
} }
function onBadgeRegLogs (logs) { function onBadgeRegLogs (logs) {
return badgeReg.getContract()
.then((badgeRegContract) => {
logs = badgeRegContract.parseEventLogs(logs);
const ids = logs.map((log) => log.params.id.value.toNumber()); const ids = logs.map((log) => log.params.id.value.toNumber());
return fetchCertifiers(uniq(ids)); return fetchCertifiers(uniq(ids));
});
} }
function _fetchChanges () { function _fetchChanges () {