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

refactor: bonding manager #352

Merged
merged 27 commits into from
May 20, 2024

Conversation

kerber0x
Copy link
Contributor

@kerber0x kerber0x commented May 6, 2024

Description and Motivation

This PR refactors the bonding manager, fixing a couple of issues with the bonding and claiming mechanisms. It also refactors the state, using an IndexedMap to hold both bonds and unbonds operations by a user.

Related Issues


Checklist:

  • I have read Migaloo's contribution guidelines.
  • My pull request has a sound title and description (not something vague like Update index.md)
  • All existing and new tests are passing.
  • I updated/added relevant documentation.
  • The code is formatted properly cargo fmt --all --.
  • Clippy doesn't report any issues cargo clippy -- -D warnings.
  • I have regenerated the schemas if needed cargo schema.

@kerber0x
Copy link
Contributor Author

kerber0x commented May 7, 2024

This is turning to be an overhaul of the bonding manager, not just removing a single msg 😅

@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from b499cac to 394de43 Compare May 8, 2024 15:17
@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from e61863f to 395b00d Compare May 9, 2024 12:26
@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 395b00d to c19ef89 Compare May 9, 2024 12:51
Copy link

Schema generation had missing jobs:

contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_claimable.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_global_index.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_unbonding.json

Please run just schemas locally and upload the generated schemas.

1 similar comment
Copy link

Schema generation had missing jobs:

contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_claimable.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_global_index.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_unbonding.json

Please run just schemas locally and upload the generated schemas.

@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 1dcbd7b to e3336f5 Compare May 16, 2024 16:05
@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 662c1e2 to 0a2b551 Compare May 16, 2024 16:22
Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 97.92576% with 57 lines in your changes are missing coverage. Please review.

Project coverage is 91.15%. Comparing base (0f77427) to head (1ac4516).
Report is 4 commits behind head on release/v2_contracts.

Current head 1ac4516 differs from pull request most recent head 61ed894

Please upload reports for the commit 61ed894 to get more accurate results.

Files Patch % Lines
...y_hub/bonding-manager/src/tests/unbond_withdraw.rs 98.83% 10 Missing ⚠️
...racts/liquidity_hub/bonding-manager/src/helpers.rs 93.75% 9 Missing ⚠️
...s/liquidity_hub/bonding-manager/src/tests/suite.rs 85.48% 9 Missing ⚠️
...s/liquidity_hub/bonding-manager/src/tests/claim.rs 99.22% 5 Missing ⚠️
...acts/liquidity_hub/pool-manager/src/tests/suite.rs 86.48% 5 Missing ⚠️
...acts/liquidity_hub/bonding-manager/src/contract.rs 89.74% 4 Missing ⚠️
...uidity_hub/bonding-manager/src/bonding/commands.rs 97.47% 3 Missing ⚠️
...ts/liquidity_hub/bonding-manager/src/tests/bond.rs 92.68% 3 Missing ⚠️
...liquidity_hub/bonding-manager/src/tests/queries.rs 99.07% 2 Missing ⚠️
...ity_hub/bonding-manager/src/tests/update_config.rs 97.40% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@                   Coverage Diff                    @@
##           release/v2_contracts     #352      +/-   ##
========================================================
+ Coverage                 90.09%   91.15%   +1.05%     
========================================================
  Files                       278      279       +1     
  Lines                     29604    31113    +1509     
========================================================
+ Hits                      26673    28361    +1688     
+ Misses                     2931     2752     -179     

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

@kerber0x kerber0x marked this pull request as ready for review May 16, 2024 16:29
@kerber0x kerber0x requested review from nseguias and 0xFable and removed request for nseguias and 0xFable May 16, 2024 16:29
Copy link

Schema generation had missing jobs:

contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_bonded.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_claimable.json
contracts/liquidity_hub/bonding-manager/schema/raw/response_to_unbonding.json

Please run just schemas locally and upload the generated schemas.

@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 23586f6 to 1c9120d Compare May 17, 2024 22:23
@kerber0x kerber0x changed the title Refactor/remove fill rewards coin msg refactor: bonding manager May 17, 2024
@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 1c9120d to 6df2793 Compare May 17, 2024 22:26
Copy link
Contributor

@0xFable 0xFable left a comment

Choose a reason for hiding this comment

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

LGTM, massive work here ser! Changes look good see you put in a shift reorganising some things too thats very much appreciated will make future features easier to get in.
A couple comments but overall looks class and want to see him merged
🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀

Copy link
Contributor

@nseguias nseguias left a comment

Choose a reason for hiding this comment

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

Looks good to me. Made some comments to improve the code and some questions to make sure I understand things right. Awesome work! Love seeing some convoluted tests. Once we're done we should write a big test that tries every part of the code ⭐

@kerber0x kerber0x force-pushed the refactor/remove-fill-rewards-coin-msg branch from 1ac4516 to 2bee41f Compare May 20, 2024 22:35
@kerber0x kerber0x merged commit 17ae446 into release/v2_contracts May 20, 2024
5 checks passed
@kerber0x kerber0x deleted the refactor/remove-fill-rewards-coin-msg branch May 20, 2024 22:37
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