Skip to content

Commit

Permalink
chore(repo): resolving dependency & package conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nseguias committed May 31, 2024
1 parent 6c661bd commit 37aef80
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
12 changes: 6 additions & 6 deletions contracts/liquidity_hub/pool-manager/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ pub struct OfferAmountComputation {

pub fn assert_slippage_tolerance(
slippage_tolerance: &Option<Decimal>,
deposits: &Vec<Coin>,
pools: &Vec<Coin>,
deposits: &[Coin],
pools: &[Coin],
pool_type: PoolType,
amount: Uint128,
pool_token_supply: Uint128,
Expand Down Expand Up @@ -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<Coin>) -> Option<Uint256> {
pub fn compute_d(amp_factor: &u64, deposits: &[Coin]) -> Option<Uint256> {
let n_coins = Uint128::from(deposits.len() as u128);

// sum(x_i), a.k.a S
Expand Down Expand Up @@ -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<Coin>,
swaps: &Vec<Coin>,
deposits: &[Coin],
swaps: &[Coin],
pool_token_supply: Uint128,
) -> Option<Uint128> {
// Initial invariant
Expand Down Expand Up @@ -894,7 +894,7 @@ pub fn compute_y(
no_swap: Uint128,
d: Uint256,
) -> Option<Uint128> {
let amount = compute_y_raw(n_coins, &amp_factor, x, no_swap, d)?;
let amount = compute_y_raw(n_coins, amp_factor, x, no_swap, d)?;
Some(Uint128::try_from(amount).unwrap())
}

Expand Down
4 changes: 3 additions & 1 deletion contracts/liquidity_hub/pool-manager/src/queries.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
23 changes: 12 additions & 11 deletions contracts/liquidity_hub/pool-manager/src/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Paul Stelzig [email protected]>"]
edition = "2021"

[lib]
name = "sim"
name = "sim1"

[dependencies]
pyo3 = { version = "0.17.3", features = ["auto-initialize"] }
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 37aef80

Please sign in to comment.