Problem: Wrong dict key for public keys in fixtures

Solution: Fixed the fixtures
This commit is contained in:
z-bowen 2018-08-20 12:39:57 +02:00
parent cf3530ed59
commit 028a31a5f4
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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}
]

View File

@ -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