Skip to content

Commit

Permalink
Fix get_validator_set empty key condition (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: Angel Petrov <146711006+Angel-Petrov@users.noreply.github.com>
  • Loading branch information
Angel-Petrov authored Dec 18, 2023
1 parent f8644ec commit e65aa1d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ impl super::State for ValidatorStateClient {
for validator in resp.validators.iter() {
let node_id = ids::node::Id::from_slice(&validator.node_id);

let mut public_key: Option<Key> = None;
if !resp.validators.is_empty() {
public_key = Some(Key::from_bytes(&validator.public_key)?);
}
let public_key = if !validator.public_key.is_empty() {
Some(Key::from_bytes(&validator.public_key)?)
} else {
None
};
validators.insert(
node_id,
GetValidatorOutput {
Expand Down

0 comments on commit e65aa1d

Please sign in to comment.