diff --git a/nkms_eth/agents.py b/nkms_eth/agents.py index 7ea135d4e..12c0dc164 100644 --- a/nkms_eth/agents.py +++ b/nkms_eth/agents.py @@ -64,12 +64,11 @@ class NuCypherKMSTokenAgent(EthereumContractAgent): class MinerAgent(EthereumContractAgent): """ - Wraps NuCypher's Escrow solidity smart contract, and manages a PopulusContract. + Wraps NuCypher's Escrow solidity smart contract, and manages a... PopulusContract? In order to become a participant of the network, a miner locks tokens by depositing to the Escrow contract address for a duration measured in periods. - """ _deployer = MinerEscrowDeployer diff --git a/tests/contracts/test_dispatcher.py b/tests/contracts/test_dispatcher.py index e34b75858..30a9f8bfe 100644 --- a/tests/contracts/test_dispatcher.py +++ b/tests/contracts/test_dispatcher.py @@ -1,6 +1,6 @@ import pytest from ethereum.tester import TransactionFailed -from populus.contracts.contract import PopulusContract +from web3.contract import Contract def test_dispatcher(web3, chain): @@ -38,7 +38,7 @@ def test_dispatcher(web3, chain): contract_instance = web3.eth.contract( contract_interface.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Only owner can change target address for dispatcher with pytest.raises(TransactionFailed): @@ -128,7 +128,7 @@ def test_dispatcher(web3, chain): contract_instance = web3.eth.contract( contract2_lib.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Check new method and finish upgrade method assert contract_instance.call().storageValueToCheck() == 1 @@ -182,7 +182,7 @@ def test_dispatcher(web3, chain): contract_instance = web3.eth.contract( contract1_lib.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) tx = contract_instance.transact().createEvent(33) chain.wait.for_receipt(tx) events = contract_instance.pastEvents('EventV1').get() @@ -197,7 +197,7 @@ def test_dispatcher(web3, chain): contract_instance = web3.eth.contract( contract2_lib.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) assert dispatcher.call().target().lower() == contract3_lib.address.lower() assert contract_instance.call().returnValue() == 20 assert contract_instance.call().getStorageValue() == 5 @@ -237,7 +237,7 @@ def test_dispatcher(web3, chain): contract_instance = web3.eth.contract( contract1_lib.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) events = contract_instance.pastEvents('EventV1').get() assert 1 == len(events) assert 33 == events[0]['args']['value'] diff --git a/tests/contracts/test_government.py b/tests/contracts/test_government.py index 448db14d4..972eed4ce 100644 --- a/tests/contracts/test_government.py +++ b/tests/contracts/test_government.py @@ -1,6 +1,6 @@ import pytest from ethereum.tester import TransactionFailed -from populus.contracts.contract import PopulusContract +from web3.contract import Contract NULL_ADDR = '0x' + '0' * 40 @@ -44,7 +44,7 @@ def escrow(web3, chain): escrow = web3.eth.contract( escrow_library.abi, escrow_dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) return escrow @@ -76,7 +76,7 @@ def test_voting(web3, chain, escrow, policy_manager): government = web3.eth.contract( government_library.abi, government_dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Transfer ownership tx = government.transact({'from': creator}).transferOwnership(government.address) @@ -250,7 +250,7 @@ def test_upgrade(web3, chain, escrow, policy_manager): government = web3.eth.contract( government_library_v1.abi, government_dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Deploy second version of the government contract government_library_v2, _ = chain.provider.deploy_contract( @@ -450,7 +450,7 @@ def test_verifying_state(web3, chain): government = web3.eth.contract( government_library_v2.abi, government_dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Upgrade to the second version tx = government_dispatcher.transact({'from': creator}).upgrade(government_library_v2.address) diff --git a/tests/contracts/test_issuer.py b/tests/contracts/test_issuer.py index 10b976f7b..5c82f2d88 100644 --- a/tests/contracts/test_issuer.py +++ b/tests/contracts/test_issuer.py @@ -1,6 +1,6 @@ import pytest from ethereum.tester import TransactionFailed -from populus.contracts.contract import PopulusContract +from web3.contract import Contract @pytest.fixture() @@ -122,7 +122,7 @@ def test_verifying_state(web3, chain, token): contract = web3.eth.contract( contract_library_v2.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Give Miner tokens for reward and initialize contract tx = token.transact({'from': creator}).transfer(contract.address, 10000) diff --git a/tests/contracts/test_miners_escrow.py b/tests/contracts/test_miners_escrow.py index 8e2a769ab..c5d37d1ea 100644 --- a/tests/contracts/test_miners_escrow.py +++ b/tests/contracts/test_miners_escrow.py @@ -1,7 +1,7 @@ import pytest from ethereum.tester import TransactionFailed import os -from populus.contracts.contract import PopulusContract +from web3.contract import Contract MINERS_LENGTH = 0 @@ -52,7 +52,7 @@ def escrow_contract(web3, chain, token, request): contract = web3.eth.contract( contract.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) return contract return make_escrow @@ -760,7 +760,7 @@ def test_verifying_state(web3, chain, token): contract = web3.eth.contract( contract_library_v2.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) assert 1500 == contract.call().maxAllowableLockedTokens() # Initialize contract and miner diff --git a/tests/contracts/test_policy_manager.py b/tests/contracts/test_policy_manager.py index 26a8c3fd7..0bf3f281e 100644 --- a/tests/contracts/test_policy_manager.py +++ b/tests/contracts/test_policy_manager.py @@ -1,7 +1,7 @@ import pytest from ethereum.tester import TransactionFailed import os -from populus.contracts.contract import PopulusContract +from web3.contract import Contract CLIENT_FIELD = 0 @@ -58,7 +58,7 @@ def policy_manager(web3, chain, escrow, request): contract = web3.eth.contract( contract.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) tx = escrow.transact({'from': creator}).setPolicyManager(contract.address) chain.wait.for_receipt(tx) @@ -606,7 +606,7 @@ def test_verifying_state(web3, chain): contract = web3.eth.contract( contract_library_v2.abi, dispatcher.address, - ContractFactoryClass=PopulusContract) + ContractFactoryClass=Contract) # Upgrade to the second version assert address1 == contract.call().escrow().lower()