-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DealSponsored event handler #23
Conversation
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.
Just one commentary
src/Modules/IexecPoco.ts
Outdated
let dealSponsoredEvent = new DealSponsored(createEventID(event)); | ||
dealSponsoredEvent.transaction = logTransaction(event).id; |
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.
you should load an entity before creating it. It prevent bugs when the graphNode make some re-indexing tricks:
let dealSponsoredEvent = new DealSponsored(createEventID(event)); | |
dealSponsoredEvent.transaction = logTransaction(event).id; | |
let dealSponsored = DealSponsored.load(createEventID(event)) | |
if (!dealSponsored){ | |
dealSponsored = new DealSponsored(createEventID(event)); | |
} | |
dealSponsored.transaction = logTransaction(event).id; |
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.
Thanks :)
No description provided.