From bac26c4a1d0802db99ca58216586419abdc33d9f Mon Sep 17 00:00:00 2001 From: z-bowen Date: Wed, 12 Sep 2018 13:28:14 +0200 Subject: [PATCH] Problem: `MigrationElection` needs CLI methods Solution: Updated the definition of `election` to include the new `migration` type --- bigchaindb/commands/election_types.py | 9 +++++++++ tests/commands/test_commands.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/bigchaindb/commands/election_types.py b/bigchaindb/commands/election_types.py index b57522f6..8220f4a0 100644 --- a/bigchaindb/commands/election_types.py +++ b/bigchaindb/commands/election_types.py @@ -16,5 +16,14 @@ elections = { 'help': 'Path to the private key of the election initiator.' } } + }, + 'migration': { + 'help': 'Call for a halt to block production to allow for a version change across breaking changes.', + 'args': { + '--private-key': { + 'dest': 'sk', + 'help': 'Path to the private key of the election initiator.' + } + } } } diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 38e251d8..97073940 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -26,6 +26,8 @@ def test_make_sure_we_dont_remove_any_command(): assert parser.parse_args(['start']).command assert parser.parse_args(['election', 'new', 'upsert-validator', 'TEMP_PUB_KEYPAIR', '10', 'TEMP_NODE_ID', '--private-key', 'TEMP_PATH_TO_PRIVATE_KEY']).command + assert parser.parse_args(['election', 'new', 'migration', + '--private-key', 'TEMP_PATH_TO_PRIVATE_KEY']).command assert parser.parse_args(['election', 'approve', 'ELECTION_ID', '--private-key', 'TEMP_PATH_TO_PRIVATE_KEY']).command assert parser.parse_args(['election', 'show', 'ELECTION_ID']).command