PubKey issue resolved

This commit is contained in:
ArpitShukla007 2022-02-02 08:47:28 +00:00
parent 959d2e98f0
commit d79f92c8c9
2 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import pytest
import random
from tendermint.abci import types_pb2 as types
from tendermint.crypto import keys_pb2
from planetmint import App
from planetmint.backend.localmongodb import query
@ -40,7 +41,7 @@ def generate_address():
def generate_validator():
pk, _ = generate_key_pair()
pub_key = types.PubKey(type='ed25519', data=pk.encode())
pub_key = keys_pb2.PublicKey(ed25519=pk.encode())
val = types.ValidatorUpdate(power=10, pub_key=pub_key)
return val

View File

@ -296,7 +296,7 @@ def test_get_validator_update(b, node_keys, node_key, ed25519_node_keys):
update = Election.process_block(b, 4, [tx_vote0, tx_vote1, tx_vote2])
assert len(update) == 1
update_public_key = codecs.encode(update[0].pub_key.data, 'base64').decode().rstrip('\n')
update_public_key = codecs.encode(update[0].pub_key.ed25519, 'base64').decode().rstrip('\n')
assert update_public_key == public_key64
# remove validator
@ -319,7 +319,7 @@ def test_get_validator_update(b, node_keys, node_key, ed25519_node_keys):
update = Election.process_block(b, 9, [tx_vote2])
assert len(update) == 1
update_public_key = codecs.encode(update[0].pub_key.data, 'base64').decode().rstrip('\n')
update_public_key = codecs.encode(update[0].pub_key.ed25519, 'base64').decode().rstrip('\n')
assert update_public_key == public_key64
# assert that the public key is not a part of the current validator set