Skip to content

Commit

Permalink
multisig interactor minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Apr 7, 2024
1 parent 17c9e62 commit 9b91546
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 7 additions & 0 deletions contracts/examples/multisig/interact/src/multisig_interact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ impl MultisigInteract {
println!("successfully performed sign action `{action_ids:?}`");
}

async fn sign_if_quorum_not_reached(&mut self, action_id: usize) {
if !self.quorum_reached(action_id).await {
self.sign(&[action_id]).await;
}
println!("quorum reached for action `{action_id}`");
}

async fn dns_register(&mut self, name: &str) {
let dns_address = dns_address_for_name(name);
self.interactor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ impl MultisigInteract {

println!("perfoming issue collection with all roles action `{action_id}`...");

if !self.quorum_reached(action_id).await {
self.sign(&[action_id]).await;
}
println!("quorum reached for action `{action_id}`");
self.sign_if_quorum_not_reached(action_id).await;

let new_token_id = self
.interactor
Expand Down Expand Up @@ -127,10 +124,7 @@ impl MultisigInteract {

println!("perfoming issue collection action `{action_id}`...");

if !self.quorum_reached(action_id).await {
self.sign(&[action_id]).await;
}
println!("quorum reached for action `{action_id}`");
self.sign_if_quorum_not_reached(action_id).await;

let new_token_id = self
.interactor
Expand Down

0 comments on commit 9b91546

Please sign in to comment.