Skip to content
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

[MEX-376] migrate positions transactions #1208

Conversation

claudiulataretu
Copy link
Collaborator

Reasoning

  • users will have to initialize the total farm position with all their positions on a farm;
  • users will perform a migration by claiming rewards with all the positions;

Proposed Changes

  • added method to get farm token migration nonce from smart contract;
  • added method to generate claim rewards transactions for all farm positions with lower nonce than migration nonce;

How to test

query MigrateToFarmPosition {
	migrateTotalFarmPositionsProxy(
		proxyAddress: <proxy_address>
	) {
            data
        }
}
query MigrateToFarmPosition {
	migrateTotalFarmPositions(
		farmAddress: <farm_address>
	) {
		data
	}
}
  • queries should return transactions if user had positions in farm prior to upgrade

         to initialize user total farm position

Signed-off-by: Claudiu Lataretu <[email protected]>
- add unit tests for generate migration transactions for user total farm
position

Signed-off-by: Claudiu Lataretu <[email protected]>
- add unit tests for generate migration transactions for user total farm
positions

Signed-off-by: Claudiu Lataretu <[email protected]>
Signed-off-by: Claudiu Lataretu <[email protected]>
Signed-off-by: Claudiu Lataretu <[email protected]>
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (4dffeae) 56.09% compared to head (0667e7c) 56.16%.
Report is 3 commits behind head on feat/farm-multiple-positions-boost.

❗ Current head 0667e7c differs from pull request most recent head 7102216. Consider uploading reports for the commit 7102216 to get more accurate results

Additional details and impacted files
@@                          Coverage Diff                           @@
##           feat/farm-multiple-positions-boost    #1208      +/-   ##
======================================================================
+ Coverage                               56.09%   56.16%   +0.07%     
======================================================================
  Files                                     235      237       +2     
  Lines                                    7835     7987     +152     
  Branches                                  520      541      +21     
======================================================================
+ Hits                                     4395     4486      +91     
- Misses                                   2997     3039      +42     
- Partials                                  443      462      +19     
Flag Coverage Δ
unittests 56.16% <69.38%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/modules/farm/mocks/farm.constants.ts 100.00% <ø> (ø)
src/modules/farm/mocks/farm.v2.abi.service.mock.ts 33.33% <100.00%> (+4.76%) ⬆️
...es/multiversx-communication/mx.api.service.mock.ts 83.33% <100.00%> (+1.51%) ⬆️
src/modules/proxy/mocks/proxy.abi.service.mock.ts 78.57% <66.66%> (+7.14%) ⬆️
...es/farm/v2/services/farm.v2.transaction.service.ts 68.75% <72.72%> (ø)
...ices/proxy-farm/proxy.farm.transactions.service.ts 46.87% <84.00%> (ø)
...rc/modules/farm/v2/services/farm.v2.abi.service.ts 25.49% <12.50%> (-0.56%) ⬇️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gabrielmatei
gabrielmatei previously approved these changes Oct 6, 2023
Signed-off-by: Claudiu Lataretu <[email protected]>
gabrielmatei
gabrielmatei previously approved these changes Oct 10, 2023
@claudiulataretu claudiulataretu merged commit 7475c45 into feat/farm-multiple-positions-boost Oct 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants