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

fix: lm redeposit_lp_shares() #596

Merged
merged 3 commits into from Jan 25, 2023
Merged

Conversation

martinfridrich
Copy link
Contributor

@martinfridrich martinfridrich commented Jan 25, 2023

This PR updates repo to latest warehouse and fixes bug in liquidity-mining's redeposit_lp_shares() function.

Bug:

AssetPair provided to redeposit_lp_shares() by users is not checked with Deposit so users can provide different AssetPair than is Deposit for.
This can result in wrong information in the event or/and bypassing xyk pool existence check.

Solution:

Check amm_pool_id from the deposit with amm_pool_id generated from AssetPair.

@github-actions
Copy link

Crate versions that have been updated:

  • runtime-integration-tests: v0.8.7 -> v0.8.8
  • parachain-runtime-mock: v0.1.6 -> v0.1.7
  • pallet-duster: v3.1.10 -> v3.1.11
  • pallet-lbp: v4.6.5 -> v4.6.6
  • pallet-marketplace: v5.0.7 -> v5.0.8
  • pallet-xyk: v6.1.4 -> v6.1.5
  • pallet-xyk-liquidity-mining: v1.1.1 -> v1.1.2
  • pallet-xyk-liquidity-mining-benchmarking: v1.0.6 -> v1.0.7
  • primitives: v6.4.1 -> v6.4.2
  • basilisk-runtime: v89.0.0 -> v90.0.0
  • common-runtime: v2.3.4 -> v2.3.5
  • testing-basilisk-runtime: v89.0.0 -> v90.0.0

Runtime version has been increased.

pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "e85c3c68708c7d9789d18c0a230efd436fc5ea10", default-features = false }
pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "e85c3c68708c7d9789d18c0a230efd436fc5ea10", default-features = false }
pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "e85c3c68708c7d9789d18c0a230efd436fc5ea10", default-features = false }
pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a7e28a3a7fba655d9d27668097a1666f4250a495", default-features = false}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest commit

Suggested change
pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a7e28a3a7fba655d9d27668097a1666f4250a495", default-features = false}
pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "4223029df725ee9377d86fa5e02b220c59619cf6", default-features = false}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use this command to replace it everywhere sed -i '' 's/e85c3c68708c7d9789d18c0a230efd436fc5ea10/4223029df725ee9377d86fa5e02b220c59619cf6/g' ./**/*.toml

@codecov
Copy link

codecov bot commented Jan 25, 2023

Codecov Report

Base: 84.07% // Head: 43.89% // Decreases project coverage by -40.18% ⚠️

Coverage data is based on head (0f42d89) compared to base (3f26407).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #596       +/-   ##
===========================================
- Coverage   84.07%   43.89%   -40.18%     
===========================================
  Files          15       61       +46     
  Lines        1777     4406     +2629     
===========================================
+ Hits         1494     1934      +440     
- Misses        283     2472     +2189     
Impacted Files Coverage Δ
runtime/basilisk/src/lib.rs 20.67% <ø> (ø)
runtime/testing-basilisk/src/lib.rs 11.24% <ø> (ø)
pallets/xyk-liquidity-mining/src/lib.rs 84.54% <100.00%> (+0.06%) ⬆️
runtime/common/src/weights/timestamp.rs 0.00% <0.00%> (ø)
runtime/basilisk/src/benchmarking/vesting.rs 100.00% <0.00%> (ø)
runtime/basilisk/src/benchmarking/multi_payment.rs 100.00% <0.00%> (ø)
runtime/common/src/weights/route_executor.rs 0.00% <0.00%> (ø)
node/src/rpc.rs 0.00% <0.00%> (ø)
node/src/client.rs 0.00% <0.00%> (ø)
runtime/common/src/weights/marketplace.rs 0.00% <0.00%> (ø)
... and 39 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@martinfridrich martinfridrich merged commit 3a7672d into master Jan 25, 2023
@jak-pan jak-pan deleted the fix/lm-redeposit-lp-shares branch February 22, 2024 10:59
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.

None yet

2 participants