-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rewards pallet-integration tests #428
Conversation
… with different types
… new configuration to necessary mock runtimes
… defined currencyid in config
…store of calculated percentages in pallet
…walk into reward-pallet-tests
…walk into reward-pallet-tests
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 for addressing the requested changes @gianfra-t, I really like the tests and the explicit calculations. I added some nitpicky comments again but it looks good to me overall. Great job 👍
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. Thanks for addressing all my comments and great job overall @gianfra-t 👍
Regarding #423.
As discussed in the issue, we need to ensure the proper issuance and distribution of the fee and per block reward tokens.
This is tested as follows:
In the
vault-registry
pallet, used due to the fact that it already has functions, constants and genesis configs appropriate to deploy vaults, we test here the block reward distribution. This is done in theseintegration_*
test functions. These tests cover the registry of a vault, execution of the on init function (called directly) and assertion that the vault owners can collect the rewards.In the
issue
pallet, given that it has the proper mocks for issuing and triggering the fee distribution, we test in theseintegration
module tests, we ensure that the fees are distributed to the many collateral registered vaults, and that all the vaults in thepooled-reward
pallet receive these rewards accordingly. (also have in mind the price mock for this example distribution).On the same module, we also test that nominated vault is taken into account and that the nominator gets the proper rewards and can collect them.