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

Commit

Permalink
use helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Aug 21, 2023
1 parent 3fa4c10 commit 73207b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frame/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,9 @@ impl<T: Config> Pallet<T> {
let timepoint = maybe_timepoint.ok_or(Error::<T>::NoTimepoint)?;
ensure!(m.when == timepoint, Error::<T>::WrongTimepoint);

let maybe_expiry = <MultisigExpiries<T>>::get(&id, call_hash);
// Ensure that the mutlisig did not expire.
match <MultisigExpiries<T>>::get(&id, call_hash) {
match maybe_expiry {
Some(expiry) if expiry < <frame_system::Pallet<T>>::block_number() => {
// If the multisig is expired we will take the chance to remove it now so that
// the multisig creator does not have to make a separate call to clean it up.
Expand Down Expand Up @@ -701,9 +702,7 @@ impl<T: Config> Pallet<T> {

// Clean up storage before executing call to avoid an possibility of reentrancy
// attack.
<Multisigs<T>>::remove(&id, call_hash);
<MultisigExpiries<T>>::remove(&id, call_hash);
T::Currency::unreserve(&m.depositor, m.deposit);
Self::remove_multisig(&id, call_hash, &m.depositor, m.deposit, maybe_expiry);

let result = call.dispatch(RawOrigin::Signed(id.clone()).into());
Self::deposit_event(Event::MultisigExecuted {
Expand Down

0 comments on commit 73207b7

Please sign in to comment.