From f5d5215adc0a0ccdf8e89898517b62bd58c6b59f Mon Sep 17 00:00:00 2001 From: dio-will Date: Mon, 10 Jun 2024 19:40:11 +0800 Subject: [PATCH] Deal with vaults contribution --- pallets/crowdloans/src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pallets/crowdloans/src/lib.rs b/pallets/crowdloans/src/lib.rs index 76b73a8a4..83d569e9a 100644 --- a/pallets/crowdloans/src/lib.rs +++ b/pallets/crowdloans/src/lib.rs @@ -1810,7 +1810,7 @@ pub mod pallet { ) -> DispatchResult { let ctoken = Self::ctoken_of((&lease_start, &lease_end)) .ok_or(Error::::CTokenDoesNotExist)?; - let mut vault = Self::vaults((&crowdloan, &lease_start, &lease_end)) + let vault = Self::vaults((&crowdloan, &lease_start, &lease_end)) .ok_or(Error::::VaultDoesNotExist)?; ensure!( @@ -1832,10 +1832,11 @@ pub mod pallet { let ctoken_balance = T::Assets::reducible_balance(ctoken, &who, false); ensure!(ctoken_balance >= amount, Error::::InsufficientBalance); - vault.contributed = vault - .contributed - .checked_sub(amount) - .ok_or(ArithmeticError::Underflow)?; + // NOTE: skipping the vault contribution check + // vault.contributed = vault + // .contributed + // .checked_sub(amount) + // .ok_or(ArithmeticError::Underflow)?; T::Assets::burn_from(ctoken, &who, amount)?; // SovereignAccount on relaychain must have