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

LP: Unitary testing for all pending extrinsics #1916

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions pallets/liquidity-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,6 @@ pub mod pallet {
) -> DispatchResult {
let who = ensure_signed(origin.clone())?;

ensure!(
T::PoolInspect::tranche_exists(pool_id, tranche_id),
Error::<T>::TrancheNotFound
);

let investment_id = Self::derive_invest_id(pool_id, tranche_id)?;
let metadata = T::AssetRegistry::metadata(&investment_id.into())
.ok_or(Error::<T>::TrancheMetadataNotFound)?;
Expand Down Expand Up @@ -923,6 +918,10 @@ pub mod pallet {
pub fn validate_investment_currency(
currency_id: T::CurrencyId,
) -> Result<(u128, EVMChainId), DispatchError> {
let currency = Self::try_get_general_index(currency_id)?;

let (chain_id, ..) = Self::try_get_wrapped_token(&currency_id)?;

// Ensure the currency is enabled as pool_currency
let metadata =
T::AssetRegistry::metadata(&currency_id).ok_or(Error::<T>::AssetNotFound)?;
Expand All @@ -931,10 +930,6 @@ pub mod pallet {
Error::<T>::AssetMetadataNotPoolCurrency
);

let currency = Self::try_get_general_index(currency_id)?;

let (chain_id, ..) = Self::try_get_wrapped_token(&currency_id)?;

Ok((currency, chain_id))
}

Expand Down
Loading
Loading