@@ -231,20 +231,22 @@ def deploy_solidity_contract(
231
231
all_contracts (dict): the json dictionary containing the result of compiling a file
232
232
libraries (list): A list of libraries to use in deployment
233
233
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.
237
237
timeout (int): Amount of time to poll the chain to confirm deployment
238
238
gasprice: The gasprice to provide for the transaction
239
239
"""
240
240
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 :
244
242
contract_key = contract_name
245
- else :
243
+ elif contract_path is not None :
246
244
_ , filename = os .path .split (contract_path )
247
245
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 ))
248
250
249
251
libraries = dict (libraries )
250
252
contract = all_contracts [contract_key ]
0 commit comments