Skip to content
This repository was archived by the owner on Aug 8, 2018. It is now read-only.

Commit 4605a04

Browse files
committed
First try without path and then add path.
1 parent d1c9f39 commit 4605a04

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

pyethapp/rpc_client.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,22 @@ def deploy_solidity_contract(
231231
all_contracts (dict): the json dictionary containing the result of compiling a file
232232
libraries (list): A list of libraries to use in deployment
233233
constructor_parameters (tuple): A tuple of arguments to pass to the constructor
234-
contract_path (str): If given then we are dealing with solc >= v0.4.9 and is
235-
a required argument to extract the contract data from the
236-
`all_contracts` dict.
234+
contract_path (str): If we are dealing with solc >= v0.4.9 then the path
235+
to the contract is a required argument a required argument
236+
to extract the contract data from the `all_contracts` dict.
237237
timeout (int): Amount of time to poll the chain to confirm deployment
238238
gasprice: The gasprice to provide for the transaction
239239
"""
240240

241-
if contract_path is None:
242-
if contract_name not in all_contracts:
243-
raise ValueError('Unknown contract {}'.format(contract_name))
241+
if contract_name in all_contracts:
244242
contract_key = contract_name
245-
else:
243+
elif contract_path is not None:
246244
_, filename = os.path.split(contract_path)
247245
contract_key = filename + ":" + contract_name
246+
if contract_key not in all_contracts:
247+
raise ValueError('Unknown contract {}'.format(contract_name))
248+
else:
249+
raise ValueError('Unknown contract {} and no contract_path given'.format(contract_name))
248250

249251
libraries = dict(libraries)
250252
contract = all_contracts[contract_key]

0 commit comments

Comments
 (0)