Problem: Upsert valdiator 'new' doesn't accept public in base64 format

Solution: Tendermint stores all keys in base64 format so it would suitable to
abandon base58 encoding in favour of base64 encoding
This commit is contained in:
Vanshdeep Singh 2018-08-27 12:32:59 +02:00
parent df6af78a69
commit eddb59b42a
2 changed files with 6 additions and 4 deletions

View File

@ -29,6 +29,8 @@ from bigchaindb.commands import utils
from bigchaindb.commands.utils import (configure_bigchaindb,
input_on_stderr)
from bigchaindb.log import setup_logging
from bigchaindb.tendermint_utils import public_key_from_base64
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@ -126,7 +128,7 @@ def run_upsert_validator_new(args, bigchain):
"""
new_validator = {
'public_key': args.public_key,
'public_key': public_key_from_base64(args.public_key),
'power': args.power,
'node_id': args.node_id
}

View File

@ -397,7 +397,7 @@ def test_upsert_validator_new_without_tendermint(b, priv_validator_path, user_sk
args = Namespace(action='new',
public_key='CJxdItf4lz2PwEf4SmYNAu/c/VpmX39JEgC5YpH7fxg=',
power=1,
node_id='12345',
node_id='fb7140f03a4ffad899fabbbf655b97e0321add66',
sk=priv_validator_path,
config={})
resp = run_upsert_validator_new(args, b)
@ -410,11 +410,11 @@ def test_upsert_validator_approve_with_tendermint(b, priv_validator_path, user_s
from bigchaindb.commands.bigchaindb import run_upsert_validator_new, \
run_upsert_validator_approve
public_key = '8eJ8q9ZQpReWyQT5aFCiwtZ5wDZC4eDnCen88p3tQ6ie'
public_key = 'CJxdItf4lz2PwEf4SmYNAu/c/VpmX39JEgC5YpH7fxg='
new_args = Namespace(action='new',
public_key=public_key,
power=1,
node_id='12345',
node_id='fb7140f03a4ffad899fabbbf655b97e0321add66',
sk=priv_validator_path,
config={})