Skip to content

Commit

Permalink
Merge pull request #68 from yihuang/impl_validator_set_lookup
Browse files Browse the repository at this point in the history
impl lite::ValidatorSetLookup
  • Loading branch information
liamsi committed Nov 13, 2019
2 parents e1a7560 + b156709 commit c8d17a9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tendermint/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ impl lite::ValidatorSet for Set {
}
}

impl lite::ValidatorSetLookup for Set {
fn validator(&self, val_id: account::Id) -> Option<Self::Validator> {
self.validators
.iter()
.cloned()
.find(|val| val.address == val_id)
}
}

/// Validator information
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Info {
Expand Down

0 comments on commit c8d17a9

Please sign in to comment.