When we update productPool data we fetch all the pools for a product and it data, if manager removes product from the pool by changing the values to 0, we don't update it since StakingViewer only returns only pools that have those values. Stale data never gets removed and then is used in calculation, that gives bigger capacities. Currently the only way to fix this is to remove cache file and refetch data.
Issue: #91
Changes proposed in this pull request
Add an action to remove old data from the store so it's doesn't affect the result in the capacity and quote engines
Convert type in the events from BigNumber to number for poolId
Test plan
Add synchronizer tests that also include the test for the fix
Checklist
[x] Rebased the base branch
[x] Attached corresponding Github issue
[x] Prefixed the name with the type of change (i.e. feat, chore, test)
[x] Performed a self-review of my own code
[x] Followed the style guidelines of this project
[ ] Made corresponding changes to the documentation
[x] Didn't generate new warnings
[x] Didn't generate failures on existing tests
[x] Added tests that prove my fix is effective or that my feature works
Review
When reviewing a PR, please indicate intention in comments using the following emojis:
:cake: = Nice to have but not essential.
:bulb: = Suggestion or a comment based on personal opinion
:hammer: = I believe this should be changed.
:thinking: = I don’t understand something, do you mind giving me more context?
Context
When we update productPool data we fetch all the pools for a product and it data, if manager removes product from the pool by changing the values to 0, we don't update it since StakingViewer only returns only pools that have those values. Stale data never gets removed and then is used in calculation, that gives bigger capacities. Currently the only way to fix this is to remove cache file and refetch data.
Issue: #91
Changes proposed in this pull request
Test plan
Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: