From f9d7b639504892755323c30c04278533a568bfd4 Mon Sep 17 00:00:00 2001 From: Lovesh Date: Sat, 24 Feb 2018 01:53:13 +0300 Subject: [PATCH 1/2] fix KeyError for "services" when pool ledger contains node update txns Signed-off-by: Lovesh (cherry picked from commit 83837b4) Signed-off-by: ashcherbakov --- indy_node/server/upgrader.py | 4 ++-- ...edules_upgrade_after_pool_ledger_update.py | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 indy_node/test/upgrade/test_node_schedules_upgrade_after_pool_ledger_update.py diff --git a/indy_node/server/upgrader.py b/indy_node/server/upgrader.py index 4189423e5..b67413ff0 100644 --- a/indy_node/server/upgrader.py +++ b/indy_node/server/upgrader.py @@ -258,8 +258,8 @@ def isScheduleValid(self, schedule, node_srvs, force) -> (bool, str): Validates schedule of planned node upgrades :param schedule: dictionary of node ids and upgrade times - :param nodeSrvs: dictionary of node ids and services - :return: whether schedule valid + :param node_srvs: dictionary of node ids and services + :return: a 2-tuple of whether schedule valid or not and the reason """ # flag "force=True" ignore basic checks! only datetime format is diff --git a/indy_node/test/upgrade/test_node_schedules_upgrade_after_pool_ledger_update.py b/indy_node/test/upgrade/test_node_schedules_upgrade_after_pool_ledger_update.py new file mode 100644 index 000000000..74b45b258 --- /dev/null +++ b/indy_node/test/upgrade/test_node_schedules_upgrade_after_pool_ledger_update.py @@ -0,0 +1,21 @@ +import pytest + +from plenum.test.bls.helper import change_bls_key, check_bls_key +from plenum.test.conftest import pool_txn_stewards_data, stewards_and_wallets + + +@pytest.fixture(scope="module") +def update_bls_keys(looper, tconf, nodeSet, stewards_and_wallets): + node = nodeSet[0] + steward_client, steward_wallet = stewards_and_wallets[0] + new_blspk = change_bls_key(looper, nodeSet, node, + steward_client, steward_wallet) + + check_bls_key(new_blspk, node, nodeSet) + + +def test_node_schedules_upgrade_after_bls_keys_update(update_bls_keys, + upgradeScheduled): + # Upgrade should work even after an update to the pool ledger with a + # transaction that does not contain `SERVICES` field + pass From a2590e5b996d7a6cad6a950ca2c98467b01975c5 Mon Sep 17 00:00:00 2001 From: ashcherbakov Date: Mon, 26 Feb 2018 12:30:39 +0300 Subject: [PATCH 2/2] increment plenum Signed-off-by: ashcherbakov --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c71c85df9..eec2249e1 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ data_files=[( (BASE_DIR, ['data/nssm_original.exe']) )], - install_requires=['indy-plenum==1.2.33', + install_requires=['indy-plenum==1.2.34', 'indy-anoncreds==1.0.11', 'python-dateutil', 'timeout-decorator'],