Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix tests and re-introduce reserve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ruseinov committed Sep 12, 2022
1 parent 36534f0 commit 7bacd73
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 287 deletions.
10 changes: 7 additions & 3 deletions frame/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use frame_support::{
DispatchErrorWithPostInfo, DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo,
},
ensure,
traits::{Currency, Get, ReservableCurrency, WrapperKeepOpaque},
traits::{Currency, Get, ReservableCurrency},
weights::{GetDispatchInfo, Weight},
RuntimeDebug,
};
Expand Down Expand Up @@ -592,7 +592,8 @@ impl<T: Config> Pallet<T> {
Err(Error::<T>::AlreadyApproved)?
}

let final_weight = T::WeightInfo::as_multi_approve(other_signatories_len as u32, call_len as u32);
let final_weight =
T::WeightInfo::as_multi_approve(other_signatories_len as u32, call_len as u32);
// Call is not made, so the actual weight does not include call
Ok(Some(final_weight).into())
}
Expand All @@ -603,6 +604,8 @@ impl<T: Config> Pallet<T> {
// Just start the operation by recording it in storage.
let deposit = T::DepositBase::get() + T::DepositFactor::get() * threshold.into();

T::Currency::reserve(&who, deposit)?;

<Multisigs<T>>::insert(
&id,
call_hash,
Expand All @@ -615,7 +618,8 @@ impl<T: Config> Pallet<T> {
);
Self::deposit_event(Event::NewMultisig { approving: who, multisig: id, call_hash });

let final_weight = T::WeightInfo::as_multi_create(other_signatories_len as u32, call_len as u32);
let final_weight =
T::WeightInfo::as_multi_create(other_signatories_len as u32, call_len as u32);
// Call is not made, so the actual weight does not include call
Ok(Some(final_weight).into())
}
Expand Down
Loading

0 comments on commit 7bacd73

Please sign in to comment.