-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
logs = contract.parseEventLogs(logs); | ||
logs.forEach((log) => { | ||
const certifier = certifiers.find((c) => c.address === log.address); | ||
if (!certifier) { | ||
console.warn(certifiers, log); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add at least which function it comes from (although it is implicit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a debug I forgot to remove...
const Confirmed = contract.events.find((e) => e.name === 'Confirmed'); | ||
const Revoked = contract.events.find((e) => e.name === 'Revoked'); | ||
|
||
return (store) => { | ||
const onLogs = (logs) => { | ||
let certifiers = []; | ||
let accounts = []; // these are addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we rather name it "addresses" instead of the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could (was like this already in the code)
return this._registry | ||
.getContract('badgereg') | ||
return this | ||
.getContract() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 Definitely prefer this approach & consistency.
Don't fetch certifiers one every new page navigation (eg. switching from accounts to address book triggers a fetch for every certifiers, which on Ropsten outputs warnings logs for inexisting ones).
Fetch them once, and then fetch when needed based on Event Logs.