Skip to content
Snippets Groups Projects
Commit d56ed42e authored by adorda's avatar adorda
Browse files

Arreglados problemas de parametros en constructor

parent 13e27fcc
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment