We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcd1396 commit e50ae7cCopy full SHA for e50ae7c
mithril-stm/src/stm.rs
@@ -556,13 +556,9 @@ impl<D: Digest + Clone + FixedOutput> StmClerk<D> {
556
StmAggrVerificationKey::from(&self.closed_reg)
557
}
558
559
- /// Get the (VK, stake) of a party given it's index.
+ /// Get the (VK, stake) of a party given its index.
560
pub fn get_reg_party(&self, party_index: &Index) -> Option<(StmVerificationKey, Stake)> {
561
- if *party_index as usize >= self.closed_reg.reg_parties.len() {
562
- return None;
563
- }
564
-
565
- Some(self.closed_reg.reg_parties[*party_index as usize].into())
+ self.closed_reg.reg_parties.get(*party_index as usize).map(|r| r.into())
566
567
568
0 commit comments