-
Notifications
You must be signed in to change notification settings - Fork 370
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
Test that events that are emitted during block finalization are included in the blocks #1798
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1798 +/- ##
=======================================
Coverage 74.42% 74.42%
=======================================
Files 281 281
Lines 7824 7824
Branches 975 975
=======================================
Hits 5823 5823
Misses 1884 1884
Partials 117 117
Continue to review full report at Codecov.
|
@@ -687,6 +687,15 @@ describe('governance tests', () => { | |||
} | |||
} | |||
}) | |||
|
|||
it('should have emitted transfer events when paying epoch rewards', async () => { |
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.
Can we test that the correct events are emitted, and also that the events are only emitted during epoch blocks?
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.
Ok, adding more checks.
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.
Ah, didn't realize that we don't actually emit the main events that we'd want to record.
More specifically, can we check that the following events are emitted in finalizing the last block of the epoch, and that no events are emitted in finalizing any other block?
TargetVotingYieldUpdated
(needs to be added to EpochRewards.updateTargetVotingYield
)
ValidatorEpochPaymentDistributed
(needs to be added to Validators.distributeEpochPayementsFromSigner
)
EpochRewardsDistributedToVoters
(needs to be added to Election.distributeEpochRewards
)
And can you please add unit tests that check for these events as well?
Thanks!
…into extra-receipt-test
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.
Love it!
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.
LGTM
Description
Just a simple test to check if these events are actually included in the blocks.
Tested
Other changes
Also added some new events that are emitted when paying epoch rewards.
Related issues
Backwards compatibility