diff --git a/bigchaindb/commands/bigchaindb.py b/bigchaindb/commands/bigchaindb.py index 8feabef6..bf6bde52 100644 --- a/bigchaindb/commands/bigchaindb.py +++ b/bigchaindb/commands/bigchaindb.py @@ -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 } diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 8d7b0725..049d3069 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -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={})