diff --git a/gateway/gateway.py b/gateway/gateway.py index 85cf65a4982614e8431bd6a9ffecb27a9e6749a9..a363acd7f2a428f00d63f1fb1eb384f860af317e 100644 --- a/gateway/gateway.py +++ b/gateway/gateway.py @@ -204,21 +204,23 @@ class ContractDeployer: def __init__(self, gateway): self.gateway = gateway - def deploy_contract(self, abi, bytecode, gas, from_account, wait=False): + def deploy_contract(self, abi, bytecode, gas, from_account, params, wait): + if params is None: + params = {} logger.debug("Deploying contract from account: {}".format(str(from_account))) contrato = self.gateway.get_undeployed_contract(abi, bytecode) # Submit the transaction that deploys the contract - tx_hash = contrato.constructor().transact({'from': from_account, 'gas': gas, 'gasLimit': gas}) + tx_hash = contrato.constructor(**params).transact({'from': from_account, 'gas': gas, 'gasLimit': gas}) logger.debug("Transaction hash for contract deploy : {}".format(str(tx_hash.hex()))) # Wait for the transaction to be mined, and get the transaction receipt tx_receipt = self.gateway.get_receipt(tx_hash, wait) logger.debug("Receipt for contract deploy: {}".format(str(tx_receipt))) return tx_receipt - def estimate_deploy(self, abi, bytecode): + def estimate_deploy(self, abi, bytecode, params): contrato = self.gateway.get_undeployed_contract(abi, bytecode) - return contrato.constructor().estimateGas() + return contrato.constructor(**params).estimateGas() class HTTPFastLogSearcher: