Skip to content

Commit

Permalink
Manual threshold update to fix current value
Browse files Browse the repository at this point in the history
  • Loading branch information
VlodkoMr committed Mar 21, 2024
1 parent 60ae87d commit e25c8a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions congress/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,14 @@ impl Contract {
self.members.set(&m);
}
}

// Manually update the threshold and members_len
pub fn update_threshold(&mut self) {
require!(env::predecessor_account_id() == env::current_account_id());
let (members, _) = self.members.get().unwrap();
self.members_len = members.len() as u8;
self.threshold = (self.members_len / 2) + 1;
}
}

#[cfg(all(test, not(target_arch = "wasm32")))]
Expand Down

0 comments on commit e25c8a6

Please sign in to comment.