diff --git a/bigchaindb/upsert_validator/validator_election.py b/bigchaindb/upsert_validator/validator_election.py index 4c09a2c7..89123324 100644 --- a/bigchaindb/upsert_validator/validator_election.py +++ b/bigchaindb/upsert_validator/validator_election.py @@ -39,7 +39,7 @@ class ValidatorElection(Transaction): validators = {} for validator in bigchain.get_validators(): # NOTE: we assume that Tendermint encodes public key in base64 - public_key = public_key_from_ed25519_key(key_from_base64(validator['pub_key']['value'])) + public_key = public_key_from_ed25519_key(key_from_base64(validator['pub_key']['data'])) validators[public_key] = validator['voting_power'] return validators diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index ada3617f..523f528d 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -390,7 +390,7 @@ def test_upsert_validator_new_without_tendermint(b, priv_validator_path, user_sk def mock_get(): return [ - {'pub_key': {'value': 'zL/DasvKulXZzhSNFwx4cLRXKkSM9GPK7Y0nZ4FEylM=', + {'pub_key': {'data': 'zL/DasvKulXZzhSNFwx4cLRXKkSM9GPK7Y0nZ4FEylM=', 'type': 'tendermint/PubKeyEd25519'}, 'voting_power': 10} ] diff --git a/tests/upsert_validator/conftest.py b/tests/upsert_validator/conftest.py index b2745493..f3bd87a9 100644 --- a/tests/upsert_validator/conftest.py +++ b/tests/upsert_validator/conftest.py @@ -30,7 +30,7 @@ def mock_get_validators(network_validators): validators = [] for public_key, power in network_validators.items(): validators.append({ - 'pub_key': {'type': 'AC26791624DE60', 'value': public_key}, + 'pub_key': {'type': 'AC26791624DE60', 'data': public_key}, 'voting_power': power }) return validators