From b15670985c8ba0d232fddb0fc0207f00e30fb04d Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 13 Nov 2019 17:57:30 +0800 Subject: [PATCH] impl lite::ValidatorSetLookup --- tendermint/src/validator.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tendermint/src/validator.rs b/tendermint/src/validator.rs index dbcf0e6c0..d3af30bb3 100644 --- a/tendermint/src/validator.rs +++ b/tendermint/src/validator.rs @@ -62,6 +62,15 @@ impl lite::ValidatorSet for Set { } } +impl lite::ValidatorSetLookup for Set { + fn validator(&self, val_id: account::Id) -> Option { + self.validators + .iter() + .cloned() + .find(|val| val.address == val_id) + } +} + /// Validator information #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Info {