From 37aef80e129a648437d73c9e2d59ec082966a0b7 Mon Sep 17 00:00:00 2001 From: nahem Date: Fri, 31 May 2024 13:55:37 +0200 Subject: [PATCH] chore(repo): resolving dependency & package conflicts --- .../liquidity_hub/pool-manager/src/helpers.rs | 12 +++++----- .../liquidity_hub/pool-manager/src/queries.rs | 4 +++- .../src/tests/integration_tests.rs | 23 ++++++++++--------- .../stableswap_3pool/sim/Cargo.toml | 2 +- .../src/stableswap_math/curve.rs | 2 +- xtask/src/main.rs | 1 + 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/contracts/liquidity_hub/pool-manager/src/helpers.rs b/contracts/liquidity_hub/pool-manager/src/helpers.rs index ce14fbc5..c5d0e131 100644 --- a/contracts/liquidity_hub/pool-manager/src/helpers.rs +++ b/contracts/liquidity_hub/pool-manager/src/helpers.rs @@ -492,8 +492,8 @@ pub struct OfferAmountComputation { pub fn assert_slippage_tolerance( slippage_tolerance: &Option, - deposits: &Vec, - pools: &Vec, + deposits: &[Coin], + pools: &[Coin], pool_type: PoolType, amount: Uint128, pool_token_supply: Uint128, @@ -694,7 +694,7 @@ pub fn get_asset_indexes_in_pool( // TODO: handle unwraps properly #[allow(clippy::unwrap_used)] -pub fn compute_d(amp_factor: &u64, deposits: &Vec) -> Option { +pub fn compute_d(amp_factor: &u64, deposits: &[Coin]) -> Option { let n_coins = Uint128::from(deposits.len() as u128); // sum(x_i), a.k.a S @@ -776,8 +776,8 @@ fn compute_next_d( #[allow(clippy::unwrap_used, clippy::too_many_arguments)] pub fn compute_mint_amount_for_deposit( amp_factor: &u64, - deposits: &Vec, - swaps: &Vec, + deposits: &[Coin], + swaps: &[Coin], pool_token_supply: Uint128, ) -> Option { // Initial invariant @@ -894,7 +894,7 @@ pub fn compute_y( no_swap: Uint128, d: Uint256, ) -> Option { - let amount = compute_y_raw(n_coins, &_factor, x, no_swap, d)?; + let amount = compute_y_raw(n_coins, amp_factor, x, no_swap, d)?; Some(Uint128::try_from(amount).unwrap()) } diff --git a/contracts/liquidity_hub/pool-manager/src/queries.rs b/contracts/liquidity_hub/pool-manager/src/queries.rs index ce272500..a02e4f3a 100644 --- a/contracts/liquidity_hub/pool-manager/src/queries.rs +++ b/contracts/liquidity_hub/pool-manager/src/queries.rs @@ -1,6 +1,8 @@ use std::cmp::Ordering; -use cosmwasm_std::{coin, ensure, Coin, Decimal256, Deps, Fraction, Order, StdResult, Uint128, Uint256}; +use cosmwasm_std::{ + coin, ensure, Coin, Decimal256, Deps, Fraction, Order, StdResult, Uint128, Uint256, +}; use white_whale_std::pool_manager::{ AssetDecimalsResponse, Config, PoolInfoResponse, PoolType, ReverseSimulationResponse, diff --git a/contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs b/contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs index c5bdf372..6aa03bcb 100644 --- a/contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs +++ b/contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs @@ -2130,17 +2130,18 @@ mod swapping { .create_new_epoch(|result| { result.unwrap(); }) - .create_pool( creator.clone(), - asset_infos, - vec![6u8, 6u8], - pool_fees, - PoolType::StableSwap { amp: 100 }, - Some("whale-uluna".to_string()), - vec![coin(1000, "uusd")], - |result| { - result.unwrap(); - }, - ); + .create_pool( + creator.clone(), + asset_infos, + vec![6u8, 6u8], + pool_fees, + PoolType::StableSwap { amp: 100 }, + Some("whale-uluna".to_string()), + vec![coin(1000, "uusd")], + |result| { + result.unwrap(); + }, + ); // Lets try to add liquidity suite.provide_liquidity( diff --git a/contracts/liquidity_hub/pool-network/stableswap_3pool/sim/Cargo.toml b/contracts/liquidity_hub/pool-network/stableswap_3pool/sim/Cargo.toml index eb2b6968..25ba31e2 100644 --- a/contracts/liquidity_hub/pool-network/stableswap_3pool/sim/Cargo.toml +++ b/contracts/liquidity_hub/pool-network/stableswap_3pool/sim/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Paul Stelzig paul@irulast.com>"] edition = "2021" [lib] -name = "sim" +name = "sim1" [dependencies] pyo3 = { version = "0.17.3", features = ["auto-initialize"] } diff --git a/contracts/liquidity_hub/pool-network/stableswap_3pool/src/stableswap_math/curve.rs b/contracts/liquidity_hub/pool-network/stableswap_3pool/src/stableswap_math/curve.rs index 9249a55c..f4b8308b 100644 --- a/contracts/liquidity_hub/pool-network/stableswap_3pool/src/stableswap_math/curve.rs +++ b/contracts/liquidity_hub/pool-network/stableswap_3pool/src/stableswap_math/curve.rs @@ -394,7 +394,7 @@ mod tests { use super::*; use proptest::prelude::*; use rand::Rng; - use sim::Model; + use sim1::Model; use std::cmp; /// Timestamp at 0 diff --git a/xtask/src/main.rs b/xtask/src/main.rs index ab04e749..dc4229c1 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -97,6 +97,7 @@ pub mod tasks { member.name != "fee-distributor-mock" && member.name != "stableswap-3pool" && member.name != "stable-swap-sim" + && member.name != "stable-swap-sim1" }); for contract in contracts {