Skip to content

Commit b1bacec

Browse files
authored
Fix pool account bug (#1418)
* fix pool account bug * remove comment * use older grcov version * revert to using new grcov version
1 parent 8f9d44e commit b1bacec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zrml/neo-swaps/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,8 @@ mod pallet {
12591259
liquidity_parameter >= MIN_LIQUIDITY.saturated_into(),
12601260
Error::<T>::LiquidityTooLow
12611261
);
1262-
let pool_account_id = Self::pool_account_id(&market_id);
1262+
let pool_id = <Self as PoolStorage>::next_pool_id();
1263+
let pool_account_id = Self::pool_account_id(&pool_id);
12631264
let mut reserves = BTreeMap::new();
12641265
for (&amount_in, &asset) in amounts_in.iter().zip(market.outcome_assets().iter()) {
12651266
T::MultiCurrency::transfer(asset, &who, &pool_account_id, amount_in)?;
@@ -1284,7 +1285,7 @@ mod pallet {
12841285
&pool.account_id,
12851286
T::MultiCurrency::minimum_balance(collateral),
12861287
)?;
1287-
let pool_id = <Self as PoolStorage>::add(pool)?;
1288+
let _ = <Self as PoolStorage>::add(pool)?;
12881289
MarketIdToPoolId::<T>::insert(market_id, pool_id);
12891290
Self::deposit_event(Event::<T>::PoolDeployed {
12901291
who,

0 commit comments

Comments
 (0)