We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d6bab4 commit 916f83fCopy full SHA for 916f83f
pallets/pallet-bonded-coins/src/lib.rs
@@ -315,6 +315,8 @@ pub mod pallet {
315
Slippage,
316
/// The calculated collateral is zero.
317
ZeroCollateral,
318
+ /// A pool has to contain at least one bonded currency.
319
+ ZeroBondedCurrency,
320
}
321
322
#[pallet::call]
@@ -372,6 +374,7 @@ pub mod pallet {
372
374
let checked_curve = curve.try_into().map_err(|_| Error::<T>::InvalidInput)?;
373
375
376
let currency_length = currencies.len();
377
+ ensure!(!currency_length.is_zero(), Error::<T>::ZeroBondedCurrency);
378
379
let currency_ids = T::NextAssetIds::try_get(currency_length.saturated_into())
380
.map_err(|e| e.into())
0 commit comments