Estimate gas updates to latest test constants; Additional commentary

pull/1040/head
Kieran Prasch 2019-04-19 21:05:29 +03:00
parent 4c1af5b5ab
commit 3454361251
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
3 changed files with 10 additions and 10 deletions

View File

@ -506,7 +506,7 @@ class LibraryLinkerDeployer(ContractDeployer):
if new_target == self._contract.address:
raise self.ContractDeploymentError(f"{self.contract_name} {self._contract.address} cannot target itself.")
origin_args = {'from': self.deployer_address} # FIXME
origin_args = {'from': self.deployer_address} # TODO: Gas management
txhash = self._contract.functions.upgrade(new_target, existing_secret_plaintext, new_secret_hash).transact(origin_args)
_receipt = self.blockchain.wait_for_receipt(txhash=txhash)
return txhash

View File

@ -38,8 +38,9 @@ from nucypher.config.constants import CONTRACT_ROOT
from nucypher.utilities.sandbox.constants import (
NUMBER_OF_URSULAS_IN_BLOCKCHAIN_TESTS,
NUMBER_OF_ETH_TEST_ACCOUNTS,
DEVELOPMENT_ETH_AIRDROP_AMOUNT
)
DEVELOPMENT_ETH_AIRDROP_AMOUNT,
USER_ESCROW_PROXY_DEPLOYMENT_SECRET, MINING_ADJUDICATOR_DEPLOYMENT_SECRET, POLICY_MANAGER_DEPLOYMENT_SECRET,
MINERS_ESCROW_DEPLOYMENT_SECRET)
def token_airdrop(token_agent, amount: NU, origin: str, addresses: List[str]):
@ -191,11 +192,10 @@ class TesterBlockchain(Blockchain):
origin = testerchain.interface.w3.eth.accounts[0]
deployer = Deployer(blockchain=testerchain, deployer_address=origin, bare=True)
random_deployment_secret = partial(os.urandom, DispatcherDeployer.DISPATCHER_SECRET_LENGTH)
_txhashes, agents = deployer.deploy_network_contracts(miner_secret=random_deployment_secret(),
policy_secret=random_deployment_secret(),
adjudicator_secret=random_deployment_secret(),
user_escrow_proxy_secret=random_deployment_secret())
_txhashes, agents = deployer.deploy_network_contracts(miner_secret=MINERS_ESCROW_DEPLOYMENT_SECRET,
policy_secret=POLICY_MANAGER_DEPLOYMENT_SECRET,
adjudicator_secret=MINING_ADJUDICATOR_DEPLOYMENT_SECRET,
user_escrow_proxy_secret=USER_ESCROW_PROXY_DEPLOYMENT_SECRET)
return testerchain, agents
@property

View File

@ -232,7 +232,7 @@ def test_rollback(click_runner):
contracts_to_rollback = ('MinersEscrow', # v4 -> v3
'PolicyManager', # v4 -> v3
'MiningAdjudicator', # v4 -> v3
# 'UserEscrowProxy' # v4 -> v3 # TODO
# 'UserEscrowProxy' # v4 -> v3 # TODO: Rollback support for UserEscrowProxy
)
# Execute Rollbacks
for contract_name in contracts_to_rollback:
@ -246,7 +246,7 @@ def test_rollback(click_runner):
result = click_runner.invoke(deploy, command, input=user_input, catch_exceptions=False)
assert result.exit_code == 0
records = blockchain.interface.registry.search(contract_name=contract_name) # TODO
records = blockchain.interface.registry.search(contract_name=contract_name)
assert len(records) == 4
*old_records, v3, v4 = records