diff --git a/nucypher/blockchain/eth/actors.py b/nucypher/blockchain/eth/actors.py index 41ae9d942..c083cee72 100644 --- a/nucypher/blockchain/eth/actors.py +++ b/nucypher/blockchain/eth/actors.py @@ -195,8 +195,7 @@ class ContractAdministrator(NucypherTokenActor): # For ownership transfers. ownable_deployer_classes = (*dispatched_upgradeable_deployer_classes, - StakingInterfaceRouterDeployer, - ) + StakingInterfaceDeployer) # Used in the automated deployment series. primary_deployer_classes = (*standard_deployer_classes, @@ -204,7 +203,8 @@ class ContractAdministrator(NucypherTokenActor): # Comprehensive collection. all_deployer_classes = (*primary_deployer_classes, - *aux_deployer_classes) + *aux_deployer_classes, + *ownable_deployer_classes) class UnknownContract(ValueError): pass diff --git a/nucypher/blockchain/eth/deployers.py b/nucypher/blockchain/eth/deployers.py index 7a891b310..64be20c5f 100644 --- a/nucypher/blockchain/eth/deployers.py +++ b/nucypher/blockchain/eth/deployers.py @@ -851,13 +851,14 @@ class StakingInterfaceRouterDeployer(OwnableContractMixin, ProxyContractDeployer raise NotImplementedError -class StakingInterfaceDeployer(BaseContractDeployer, UpgradeableContractMixin): +class StakingInterfaceDeployer(BaseContractDeployer, UpgradeableContractMixin, OwnableContractMixin): contract_name = 'StakingInterface' deployment_steps = ('contract_deployment', 'router_deployment') number_of_deployment_transactions = 2 _proxy_deployer = StakingInterfaceRouterDeployer - _ownable = False + + # _ownable = False # TODO: This contract is not truly ownable but we need the logic of the mixin to execute def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/nucypher/cli/commands/deploy.py b/nucypher/cli/commands/deploy.py index 77525990f..e9cf4dbae 100644 --- a/nucypher/cli/commands/deploy.py +++ b/nucypher/cli/commands/deploy.py @@ -592,9 +592,7 @@ def allocations(general_config, actor_options, allocation_infile, gas): @option_target_address @option_gas def transfer_ownership(general_config, actor_options, target_address, gas): - """ - Transfer ownership of contracts to another address. - """ + """Transfer ownership of contracts to another address.""" emitter = general_config.emitter ADMINISTRATOR, _, _, _ = actor_options.create_actor(emitter) diff --git a/tests/acceptance/cli/deploy/test_deploy_cli_commands.py b/tests/acceptance/cli/deploy/test_deploy_cli_commands.py index dd67866cc..a6287d2d6 100644 --- a/tests/acceptance/cli/deploy/test_deploy_cli_commands.py +++ b/tests/acceptance/cli/deploy/test_deploy_cli_commands.py @@ -160,6 +160,35 @@ def test_transfer_ownership(click_runner, testerchain, agency_local_registry): assert policy_agent.owner == testerchain.etherbase_account assert adjudicator_agent.owner == testerchain.etherbase_account + #### BEGIN HOTFIX TEST + + ownership_command = ('transfer-ownership', + '--registry-infile', agency_local_registry.filepath, + '--contract-name', 'StakingInterface', + '--provider', TEST_PROVIDER_URI, + '--network', TEMPORARY_DOMAIN, + '--target-address', maclane, + '--debug') + + account_index = '0\n' + yes = 'Y\n' + user_input = account_index + yes + yes + + result = click_runner.invoke(deploy, + ownership_command, + input=user_input, + catch_exceptions=False) + assert result.exit_code == 0, result.output + + # All of these are unchanged + assert staking_agent.owner == michwill + assert policy_agent.owner == testerchain.etherbase_account + assert adjudicator_agent.owner == testerchain.etherbase_account + + # TODO: Assert the new owner is correct + # This owner is updated + # assert interface_agent.owner == maclane + def test_bare_contract_deployment_to_alternate_registry(click_runner, agency_local_registry):