diff --git a/nucypher/blockchain/eth/actors.py b/nucypher/blockchain/eth/actors.py index 4efbddd6a..8f85598d4 100644 --- a/nucypher/blockchain/eth/actors.py +++ b/nucypher/blockchain/eth/actors.py @@ -1099,6 +1099,15 @@ class StakeHolder(BaseConfiguration): if staking: receipts['staking_reward'] = staker.collect_staking_reward() + # TODO: Do we need an option to skip this step? + # Send ether rewards to the funding or withdraw account. + tx = {'to': withdraw_address or self.funding_account, + 'from': staker.checksum_address, + 'value': self.eth_funding} + + txhash = self.blockchain.client.send_transaction(transaction=tx) + _ether_transfer_receipt = self.blockchain.client.wait_for_receipt(txhash, timeout=120) # TODO: Include in config? + if policy: withdraw_address = withdraw_address or self.funding_account receipts['policy_reward'] = staker.collect_policy_reward(collector_address=withdraw_address) diff --git a/nucypher/blockchain/eth/clients.py b/nucypher/blockchain/eth/clients.py index 2d41525a0..e6d31900b 100644 --- a/nucypher/blockchain/eth/clients.py +++ b/nucypher/blockchain/eth/clients.py @@ -419,7 +419,7 @@ class NuCypherGethDevProcess(NuCypherGethProcess): _CHAIN_NAME = 'poa-development' - def __init__(self, config_root: str = None, block_time: int = None, *args, **kwargs): + def __init__(self, config_root: str = None, *args, **kwargs): base_dir = config_root if config_root else DEFAULT_CONFIG_ROOT base_dir = os.path.join(base_dir, '.ethereum') @@ -430,13 +430,8 @@ class NuCypherGethDevProcess(NuCypherGethProcess): 'data_dir': self.data_dir} super().__init__(geth_kwargs=self.geth_kwargs, *args, **kwargs) - self.command = [*self.command, '--dev'] - self.block_time = int(block_time) - if self.block_time: - self.command.append(f'--dev.period {self.block_time}') - def start(self, timeout: int = 30, extra_delay: int = 1): if not self.is_running: self.LOG.info("STARTING GETH DEV PROCESS NOW") diff --git a/nucypher/config/node.py b/nucypher/config/node.py index 1d66172d2..77f4a1e91 100644 --- a/nucypher/config/node.py +++ b/nucypher/config/node.py @@ -405,7 +405,7 @@ class CharacterConfiguration(BaseConfiguration): def write_keyring(self, password: str, checksum_address: str = None, **generation_kwargs) -> NucypherKeyring: if self.federated_only: - generation_kwargs['checksum_address'] = FEDERATED_ADDRESS + checksum_address = FEDERATED_ADDRESS elif not checksum_address: diff --git a/tests/cli/ursula/test_stakeholder_and_ursula.py b/tests/cli/ursula/test_stakeholder_and_ursula.py index 754f8027d..2c6129505 100644 --- a/tests/cli/ursula/test_stakeholder_and_ursula.py +++ b/tests/cli/ursula/test_stakeholder_and_ursula.py @@ -339,8 +339,6 @@ def test_collect_rewards_integration(click_runner, # The staker is staking. assert staker.stakes assert staker.is_staking - pre_stake_token_balance = staker.token_balance - assert staker.worker_address == worker_address ursula_port = select_test_port() @@ -500,7 +498,5 @@ def test_collect_rewards_integration(click_runner, catch_exceptions=False) assert result.exit_code == 0 - # Staking Reward - calculated_reward = staker.staking_agent.calculate_staking_reward(staker_address=staker.worker_address) - assert calculated_reward - assert staker.token_agent.get_balance(address=burner_wallet) == calculated_reward + # The burner wallet has the reward ethers + assert staker.token_agent.get_balance(address=burner_wallet.address)