Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions crates/contracts/masm/auth/multisig.masm
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,20 @@ pub proc update_signers_and_threshold(multisig_config_hash: word)
drop
# => [pad(12)]

# compare initial vs current multisig config

# load init_num_of_approvers & new_num_of_approvers
loc_load.0 loc_load.1
# => [init_num_of_approvers, new_num_of_approvers, pad(12)]

exec.cleanup_pubkey_mapping
# => [pad(12)]
dup.1 dup.1
u32assert2 u32lt
# => [should_cleanup, init_num_of_approvers, new_num_of_approvers, pad(12)]

if.true
exec.cleanup_pubkey_mapping
# => [pad(12)]
else
drop drop
# => [pad(12)]
end
end

#! Update or clear the threshold override for a specific procedure.
Expand Down
16 changes: 11 additions & 5 deletions crates/contracts/masm/auth/multisig_ecdsa.masm
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,20 @@ pub proc update_signers_and_threshold(multisig_config_hash: word)
drop
# => [pad(12)]

# compare initial vs current multisig config

# load init_num_of_approvers & new_num_of_approvers
loc_load.0 loc_load.1
# => [init_num_of_approvers, new_num_of_approvers, pad(12)]

exec.cleanup_pubkey_mapping
# => [pad(12)]
dup.1 dup.1
u32assert2 u32lt
# => [should_cleanup, init_num_of_approvers, new_num_of_approvers, pad(12)]

if.true
exec.cleanup_pubkey_mapping
# => [pad(12)]
else
drop drop
# => [pad(12)]
end
end

#! Update or clear the threshold override for a specific procedure.
Expand Down
5 changes: 4 additions & 1 deletion crates/contracts/tests/auth/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ async fn test_multisig_add_signer_with_guardian_from_single_signer() -> anyhow::
NoteType::Public,
)?;

let mock_chain = mock_chain_builder.clone().build().unwrap();
let mut mock_chain = mock_chain_builder.clone().build().unwrap();

let salt = Word::from([Felt::new(9); 4]);
let mut advice_map = AdviceMap::default();
Expand Down Expand Up @@ -650,6 +650,9 @@ async fn test_multisig_add_signer_with_guardian_from_single_signer() -> anyhow::
Felt::new(1)
);

mock_chain.add_pending_executed_transaction(&update_approvers_tx)?;
mock_chain.prove_next_block()?;

let mut updated_multisig_account = multisig_account.clone();
updated_multisig_account.apply_delta(update_approvers_tx.account_delta())?;

Expand Down
Loading