Skip to content

Commit

Permalink
multisig: clear_action fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Dec 10, 2024
1 parent 13f8018 commit 8f1211f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use transaction::TxBatchSplitInFields;
use transaction::*;
use user_role::UserRole;

use core::cmp::max;
use multiversx_sc::imports::*;

const MAX_ACTIONS_INTER: usize = 10;
Expand Down Expand Up @@ -459,11 +458,8 @@ pub trait Multisig:
// if there's only one proposed action,
// the action was already cleared at the beginning of this function
if action_ids_mapper.len() > 1 {
for _ in 0..max(action_ids_mapper.len(), MAX_ACTIONS_INTER) {
match action_ids_mapper.values().next() {
Some(act_id) => self.clear_action(act_id),
None => sc_panic!("Could not retrieve an action id"),
};
for act_id in action_ids_mapper.values().take(MAX_ACTIONS_INTER) {
self.clear_action(act_id);
}
}

Expand All @@ -487,11 +483,8 @@ pub trait Multisig:
// if there's only one proposed action,
// the action was already cleared at the beginning of this function
if action_ids_mapper.len() > 1 {
for _ in 0..max(action_ids_mapper.len(), MAX_ACTIONS_INTER) {
match action_ids_mapper.values().next() {
Some(act_id) => self.clear_action(act_id),
None => sc_panic!("Could not retrieve an action id"),
};
for act_id in action_ids_mapper.values().take(MAX_ACTIONS_INTER) {
self.clear_action(act_id);
}
}

Expand Down

0 comments on commit 8f1211f

Please sign in to comment.