Skip to content

Commit

Permalink
reuse error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
enthusiastmartin committed Jul 7, 2023
1 parent 3bff612 commit 240551c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions pallets/stableswap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,6 @@ pub mod pallet {

/// New amplification is equal to the previous value.
SameAmplification,

/// Provided list of assets contains same assets.
SameAssets,
}

#[pallet::call]
Expand Down Expand Up @@ -868,7 +865,7 @@ impl<T: Config> Pallet<T> {
);
ensure!(pool.find_asset(asset.asset_id).is_some(), Error::<T>::AssetNotInPool);
if added_assets.insert(asset.asset_id, asset.amount).is_some() {
return Err(Error::<T>::SameAssets.into());
return Err(Error::<T>::IncorrectAssets.into());
}
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/stableswap/src/tests/add_liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ fn add_liquidity_should_fail_when_provided_list_contains_same_assets() {
}
]
),
Error::<Test>::SameAssets
Error::<Test>::IncorrectAssets
);
});
}

0 comments on commit 240551c

Please sign in to comment.