diff --git a/bigchaindb/upsert_validator/validator_utils.py b/bigchaindb/upsert_validator/validator_utils.py index 83df4ea6..8451c262 100644 --- a/bigchaindb/upsert_validator/validator_utils.py +++ b/bigchaindb/upsert_validator/validator_utils.py @@ -2,8 +2,7 @@ import codecs import base64 import binascii -from abci.types_pb2 import (Validator, - ValidatorUpdate, +from abci.types_pb2 import (ValidatorUpdate, PubKey) from bigchaindb.common.exceptions import InvalidPublicKey @@ -14,7 +13,7 @@ def encode_validator(v): pub_key = PubKey(type='ed25519', data=bytes.fromhex(ed25519_public_key)) return ValidatorUpdate(pub_key=pub_key, - power=v['power']) + power=v['power']) def decode_validator(v): diff --git a/tests/tendermint/conftest.py b/tests/tendermint/conftest.py index 14302f5d..7549246d 100644 --- a/tests/tendermint/conftest.py +++ b/tests/tendermint/conftest.py @@ -15,10 +15,8 @@ def validator_pub_key(): @pytest.fixture def init_chain_request(): - addr = codecs.decode(b'9FD479C869C7D7E7605BF99293457AA5D80C3033', 'hex') pk = codecs.decode(b'VAgFZtYw8bNR5TMZHFOBDWk9cAmEu3/c6JgRBmddbbI=', 'base64') - val_a = types.ValidatorUpdate( power=10, - pub_key=types.PubKey(type='ed25519', data=pk)) - + val_a = types.ValidatorUpdate(power=10, + pub_key=types.PubKey(type='ed25519', data=pk)) return types.RequestInitChain(validators=[val_a]) diff --git a/tests/tendermint/test_core.py b/tests/tendermint/test_core.py index 2ceab619..a1007633 100644 --- a/tests/tendermint/test_core.py +++ b/tests/tendermint/test_core.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 -import codecs import json import pytest import random @@ -14,7 +13,6 @@ from abci.types_pb2 import ( RequestInfo, RequestBeginBlock, RequestEndBlock, - Validator, ValidatorUpdate, ) @@ -49,10 +47,9 @@ def generate_address(): def generate_validator(): - addr = codecs.decode(generate_address(), 'hex') pk, _ = generate_key_pair() pub_key = PubKey(type='ed25519', data=pk.encode()) - val = ValidatorUpdate( power=10, pub_key=pub_key) + val = ValidatorUpdate(power=10, pub_key=pub_key) return val