def network_validators58(network_validators): network_validators_base58 = {} for p, v in network_validators.items(): p = public_key_from_ed25519_key(key_from_base64(p)) network_validators_base58[p] = v return network_validators_base58
def get_validators(cls, bigchain, height=None): """Return a dictionary of validators with key as `public_key` and value as the `voting_power` """ validators = {} for validator in bigchain.get_validators(height): # NOTE: we assume that Tendermint encodes public key in base64 public_key = public_key_from_ed25519_key(key_from_base64(validator['public_key']['value'])) validators[public_key] = validator['voting_power'] return validators
def get_validators(cls, bigchain, height=None): """Return a dictionary of validators with key as `public_key` and value as the `voting_power` """ validators = {} for validator in bigchain.get_validators(height): # NOTE: we assume that Tendermint encodes public key in base64 public_key = public_key_from_ed25519_key( key_from_base64(validator['pub_key']['data'])) validators[public_key] = validator['voting_power'] return validators