From ba8cae96ebd109dcd8b537b5eb0554ecb8059dbf Mon Sep 17 00:00:00 2001 From: Kieran Prasch Date: Mon, 19 Oct 2020 15:56:14 -0700 Subject: [PATCH] Respond to RFCs in PR #2389 --- nucypher/blockchain/eth/agents.py | 2 +- nucypher/network/nodes.py | 1 + nucypher/utilities/gas_strategies.py | 15 +++++++-------- .../test_bob_joins_policy_and_retrieves.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nucypher/blockchain/eth/agents.py b/nucypher/blockchain/eth/agents.py index 020c84248..50731d983 100644 --- a/nucypher/blockchain/eth/agents.py +++ b/nucypher/blockchain/eth/agents.py @@ -578,7 +578,7 @@ class StakingEscrowAgent(EthereumContractAgent): def commit_to_next_period(self, worker_address: ChecksumAddress, fire_and_forget: bool = True, # TODO: make fire_and_forget required? See #2385 too. - ) -> TxReceipt: + ) -> Union[TxReceipt, HexBytes]: """ For each period that the worker makes a commitment, the staker is rewarded. """ diff --git a/nucypher/network/nodes.py b/nucypher/network/nodes.py index ab8c978dd..043ae06cb 100644 --- a/nucypher/network/nodes.py +++ b/nucypher/network/nodes.py @@ -1363,6 +1363,7 @@ class Teacher: "fleet_state": node.fleet_state_checksum or 'unknown', "fleet_state_icon": fleet_icon, "domain": node.serving_domain, + 'version': nucypher.__version__ } return payload diff --git a/nucypher/utilities/gas_strategies.py b/nucypher/utilities/gas_strategies.py index 0e3cf78ad..563f1c0f9 100644 --- a/nucypher/utilities/gas_strategies.py +++ b/nucypher/utilities/gas_strategies.py @@ -57,10 +57,9 @@ def datafeed_fallback_gas_price_strategy(web3: Web3, transaction_params: TxParam # -__RAW_WEB3_GAS_STRATEGIES = {# 'glacial': time_based.glacial_gas_price_strategy, # 24h # Glacial strategy is just a risk - 'slow': time_based.slow_gas_price_strategy, # 1h +__RAW_WEB3_GAS_STRATEGIES = {'slow': time_based.slow_gas_price_strategy, # 1h 'medium': time_based.medium_gas_price_strategy, # 5m - 'fast': time_based.fast_gas_price_strategy # 60s + 'fast': time_based.fast_gas_price_strategy # 60s } @@ -79,8 +78,8 @@ def wrap_web3_gas_strategy(web3_gas_strategy: Callable): WEB3_GAS_STRATEGIES = {speed: wrap_web3_gas_strategy(strategy) for speed, strategy in __RAW_WEB3_GAS_STRATEGIES.items()} -EXPECTED_CONFIRMATION_TIME_IN_SECONDS = {# 'glacial': int(datetime.timedelta(hours=24).total_seconds()), # 24h # Glacial strategy is just a risk - 'slow': int(datetime.timedelta(hours=1).total_seconds()), # 1h - 'medium': int(datetime.timedelta(minutes=5).total_seconds()), # 5m - 'fast': 60 # 60s - } +EXPECTED_CONFIRMATION_TIME_IN_SECONDS = { + 'slow': int(datetime.timedelta(hours=1).total_seconds()), + 'medium': int(datetime.timedelta(minutes=5).total_seconds()), + 'fast': 60 +} diff --git a/tests/integration/characters/test_bob_joins_policy_and_retrieves.py b/tests/integration/characters/test_bob_joins_policy_and_retrieves.py index 6de5a1954..0b6e0ab40 100644 --- a/tests/integration/characters/test_bob_joins_policy_and_retrieves.py +++ b/tests/integration/characters/test_bob_joins_policy_and_retrieves.py @@ -241,7 +241,7 @@ def test_bob_retrieves_too_late(federated_bob, federated_ursulas, urs._datastore_pruning_task.clock = clock urs._datastore_pruning_task.start(interval=Ursula._pruning_interval) - clock.advance(86400 * 7) # 1 week + clock.advance(86400 * 8) # 1 week # TODO: this is supposed to be seven days, not eight enrico = capsule_side_channel.enrico message_kit = capsule_side_channel()