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

Allow updating config of pool-manager #328

Merged
merged 5 commits into from
Apr 16, 2024

Conversation

kaimen-sano
Copy link
Contributor

Description and Motivation

  • Allows an UpdateConfig msg to be sent to the pool-manager contract to update the contract configuration.
  • Implements a QueryMsg::Config on the pool-manager contract

Related Issues

closes #294, related to #309.

Before merging this PR, we need to have a think about how we want to handle contract ownership. We currently have the cosmwasm contract admin, the cw-ownable owner, and the Config.owner.


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.

@kaimen-sano kaimen-sano self-assigned this Apr 14, 2024
@kaimen-sano kaimen-sano added enhancement New feature or request V2 Everything related to the V2 implementation of White Whale labels Apr 14, 2024
Copy link

codecov bot commented Apr 14, 2024

Codecov Report

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

Project coverage is 89.42%. Comparing base (64ec60f) to head (c63be19).
Report is 10 commits behind head on release/v2_contracts.

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

Files Patch % Lines
...acts/liquidity_hub/pool-manager/src/tests/suite.rs 80.00% 3 Missing ⚠️
...ty_hub/pool-manager/src/tests/integration_tests.rs 97.14% 2 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/v2_contracts     #328   +/-   ##
=====================================================
  Coverage                 89.42%   89.42%           
=====================================================
  Files                       260      261    +1     
  Lines                     26656    26704   +48     
=====================================================
+ Hits                      23836    23879   +43     
- Misses                     2820     2825    +5     

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

@kerber0x kerber0x force-pushed the pool-manager-update-config branch from f8761f6 to f5d12b9 Compare April 15, 2024 14:35
@kerber0x kerber0x marked this pull request as ready for review April 15, 2024 14:35
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 🚀

withdrawals_enabled: false,
}),
|res| {
res.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM good job keeping the tests in ownership test module

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 overall, made a comments on instantiation logic & a state variable name suggestion

use crate::{
helpers::{self, calculate_stableswap_y, StableSwapDirection},
state::get_pair_by_identifier,
ContractError,
};
use crate::{math::Decimal256Helper, state::SWAP_ROUTES};

/// Query the config of the contract.
pub fn query_config(deps: Deps) -> Result<Config, ContractError> {
Ok(MANAGER_CONFIG.load(deps.storage)?)
Copy link
Contributor

Choose a reason for hiding this comment

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

given that we have several managers on V2, can we use POOL_MANAGER_CONFIG to make it super clear? Or just CONFIG

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah maybe just config could be. I remember at first we started naming them MANAGER_CONFIG cuz maybe we could have a config for the pools, or vaults... but that wasn't the case. I think we can refactor that later once all the contracts are ready.

@kerber0x kerber0x self-requested a review April 16, 2024 11:23
@kerber0x kerber0x force-pushed the pool-manager-update-config branch from c63be19 to 1412749 Compare April 16, 2024 11:33
@kerber0x kerber0x merged commit 3a605e4 into release/v2_contracts Apr 16, 2024
3 of 5 checks passed
@kerber0x kerber0x deleted the pool-manager-update-config branch April 16, 2024 11:34
kaimen-sano added a commit that referenced this pull request Apr 17, 2024
Several tests have failed due to #328 and #329. We fix these here.
@kaimen-sano kaimen-sano mentioned this pull request Apr 17, 2024
7 tasks
0xFable pushed a commit that referenced this pull request Apr 18, 2024
Several tests have failed due to #328 and #329. We fix these here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request V2 Everything related to the V2 implementation of White Whale
Projects
None yet
4 participants