-
Notifications
You must be signed in to change notification settings - Fork 190
feat(gas-rebates): update gas rebate scripts with new rules #4801
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
Conversation
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
const revealEventsMinBalance = revealEvents.filter((event) => event.args.numTokens.gte(minTokens)); | ||
|
||
// Filter out duplicate commit events as we only refund the latest commit event per voter per round | ||
const uniqueCommitEvents = new Map<string, VoteCommittedEvent>(); |
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.
this is interesting. ive had to sometimes commit more than once because theres so many votes sometimes. is this a technical or design decision
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.
looks good, im wondering if rather than taking last commit, we take most expensive commit. im thinking of the cases where i double commit, its usually because i missed one answer or felt i had to change it due to discussion, making the last commit usually cheaper than the original
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
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.
looks good
// Filter out duplicate commit events as we only refund the first commit event per voter per round | ||
const uniqueCommitEvents = new Map<string, VoteCommittedEvent>(); | ||
|
||
// Sort first by blockNumber (desc) and then by logIndex (desc) as a tiebreaker |
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.
comment
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Changes proposed in this PR: