[MEX-592] Distribute only mex in fees collector#990
[MEX-592] Distribute only mex in fees collector#990dorin-iancu wants to merge 24 commits intorc/dist-only-mex-fees-collectorfrom
Conversation
Coverage SummaryTotals
FilesExpand
|
|
Contract comparison - from ae73475 to 2b6ae52
|
energy-integration/fees-collector/src/external_sc_interactions/pair.rs
Outdated
Show resolved
Hide resolved
| continue; | ||
| } | ||
|
|
||
| let acc_fees_mapper = self.accumulated_fees(current_week, &token_id); |
There was a problem hiding this comment.
This only updates the current week. What happens for the previous weeks where the tokens were not claimed?
There was a problem hiding this comment.
I'd change this a bit, to make it completely backwards compatible. Instead of doing this, how about we take the entire balance of the SC and add them in the all_accumulated_tokens storage, for all tokens other than the base and locked tokens. We would also need to maybe clear the accumulated_fees storage for all the tokens, for the last 4 weeks before the upgrade.
| } | ||
|
|
||
| #[test] | ||
| fn fees_collector_multiple_swap_test() { |
There was a problem hiding this comment.
Add also 2 new error checks (in this test or a new one). First, where the first token is not a known token and it should throw an error. Second, a swap where the last token is not MEX and check the thrown error.
There was a problem hiding this comment.
Also, add a claim at the end, to check the swapped MEX tokens are distributed as intended and then check the users balance.
There was a problem hiding this comment.
Add a new unit test where fees are gathered for a few weeks, then do the swap in week n, and then, still in week n, a new fee deposit of another token than the base one happens. We should check the rewards are distributed correctly, the storage are updated accordingly and the all_accumulated_tokens storage still holds the last deposit.
There was a problem hiding this comment.
Only done first and third point, the second one takes way too much setup, and it's already proven through other tests.
| ); | ||
| }, | ||
| ) | ||
| .assert_ok(); |
There was a problem hiding this comment.
Also check the storage is properly cleared for the past weeks, after the rewards redistribution.
There was a problem hiding this comment.
Also, call redistribute_rewards to see what happens.
…m/multiversx/mx-exchange-sc into impl-dist-only-mex-fees-collector
No description provided.