Skip to content

Commit

Permalink
Match the argument names
Browse files Browse the repository at this point in the history
  • Loading branch information
pirapira committed Apr 29, 2019
1 parent 6669e99 commit ff8dbe1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions raiden_contracts/deploy/contract_verifyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def verify_deployed_service_contracts_in_filesystem(
if self.verify_service_contracts_deployment_data(
token_address=token_address,
user_deposit_whole_balance_limit=user_deposit_whole_balance_limit,
deployment_data=deployment_data,
deployed_contracts_info=deployment_data,
):
print(
f'Deployment info from {deployment_file_path} has been verified '
Expand All @@ -100,15 +100,15 @@ def store_and_verify_deployment_info_services(
self,
deployed_contracts_info: DeployedContracts,
token_address: str,
user_deposit_whole_limit: int,
user_deposit_whole_balance_limit: int,
):
self._store_deployment_info(
services=True,
deployment_info=deployed_contracts_info,
)
self.verify_deployed_service_contracts_in_filesystem(
token_address=token_address,
user_deposit_whole_balance_limit=user_deposit_whole_limit,
user_deposit_whole_balance_limit=user_deposit_whole_balance_limit,
)

def _store_deployment_info(
Expand Down Expand Up @@ -231,25 +231,25 @@ def verify_service_contracts_deployment_data(
self,
token_address: str,
user_deposit_whole_balance_limit: int,
deployment_data: DeployedContracts,
deployed_contracts_info: DeployedContracts,
):
chain_id = int(self.web3.version.network)
assert deployment_data is not None
assert deployed_contracts_info is not None

if self.contract_manager.version_string != deployment_data['contracts_version']:
if self.contract_manager.version_string != deployed_contracts_info['contracts_version']:
raise RuntimeError('Version string mismatch')
if chain_id != deployment_data['chain_id']:
if chain_id != deployed_contracts_info['chain_id']:
raise RuntimeError('chain_id mismatch')

service_bundle, constructor_arguments = self._verify_deployed_contract(
deployment_data=deployment_data,
deployment_data=deployed_contracts_info,
contract_name=CONTRACT_SERVICE_REGISTRY,
)
assert to_checksum_address(service_bundle.functions.token().call()) == token_address
assert token_address == constructor_arguments[0]

user_deposit, constructor_arguments = self._verify_deployed_contract(
deployment_data=deployment_data,
deployment_data=deployed_contracts_info,
contract_name=CONTRACT_USER_DEPOSIT,
)
assert len(constructor_arguments) == 2
Expand All @@ -260,7 +260,7 @@ def verify_service_contracts_deployment_data(
assert user_deposit_whole_balance_limit == constructor_arguments[1]

monitoring_service, constructor_arguments = self._verify_deployed_contract(
deployment_data,
deployed_contracts_info,
CONTRACT_MONITORING_SERVICE,
)
assert len(constructor_arguments) == 3
Expand All @@ -278,7 +278,7 @@ def verify_service_contracts_deployment_data(
assert user_deposit.address == constructor_arguments[2]

one_to_n, constructor_arguments = self._verify_deployed_contract(
deployment_data=deployment_data,
deployment_data=deployed_contracts_info,
contract_name=CONTRACT_ONE_TO_N,
)
assert to_checksum_address(
Expand Down
12 changes: 6 additions & 6 deletions raiden_contracts/tests/test_deploy_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def test_deploy_script_service(
deployer.verify_service_contracts_deployment_data(
token_address=token_address,
user_deposit_whole_balance_limit=deposit_limit,
deployment_data=deployed_service_contracts,
deployed_contracts_info=deployed_service_contracts,
)

deployed_info_fail = deepcopy(deployed_service_contracts)
Expand All @@ -459,7 +459,7 @@ def test_deploy_script_service(
deployer.verify_service_contracts_deployment_data(
token_address=token_address,
user_deposit_whole_balance_limit=deposit_limit,
deployment_data=deployed_info_fail,
deployed_contracts_info=deployed_info_fail,
)

deployed_info_fail = deepcopy(deployed_service_contracts)
Expand All @@ -468,7 +468,7 @@ def test_deploy_script_service(
deployer.verify_service_contracts_deployment_data(
token_address=token_address,
user_deposit_whole_balance_limit=deposit_limit,
deployment_data=deployed_info_fail,
deployed_contracts_info=deployed_info_fail,
)

def test_missing_deployment(contract_name):
Expand All @@ -480,7 +480,7 @@ def test_missing_deployment(contract_name):
deployer.verify_service_contracts_deployment_data(
token_address=token_address,
user_deposit_whole_balance_limit=deposit_limit,
deployment_data=deployed_info_fail,
deployed_contracts_info=deployed_info_fail,
)

for contract_name in [
Expand Down Expand Up @@ -554,13 +554,13 @@ def test_store_and_verify_services(
deployed_contracts_info = deployed_service_info
deployer.verify_service_contracts_deployment_data(
token_address=token_address,
deployment_data=deployed_contracts_info,
deployed_contracts_info=deployed_contracts_info,
user_deposit_whole_balance_limit=DEPOSIT_LIMIT,
)
deployer.store_and_verify_deployment_info_services(
token_address=token_address,
deployed_contracts_info=deployed_contracts_info,
user_deposit_whole_limit=DEPOSIT_LIMIT,
user_deposit_whole_balance_limit=DEPOSIT_LIMIT,
)


Expand Down

0 comments on commit ff8dbe1

Please sign in to comment.