Skip to content

Commit

Permalink
Show tx hash before waiting on it to be mined. Issue #55
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Jan 29, 2019
1 parent 346534c commit e7adf15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions solidbyte/deploy/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def _transact(self, tx: MultiDict) -> str:

log.debug("Deployment transaction hash for {}: {}".format(self.name, deploy_txhash.hex()))

return deploy_txhash
return deploy_txhash.hex()

def _assemble_and_hash_bytecode(self, bytecode: str,
links: Optional[dict] = None) -> Tuple[str, str]:
Expand Down Expand Up @@ -577,9 +577,13 @@ def _deploy(self, *args, **kwargs) -> Web3Contract:
log.debug("Creating deploy transaction...")
deploy_tx = self._create_deploy_transaction(bytecode, gas, gas_price, *args, **kwargs)

log.info("Sending deploy transaction for {}. This may take a moment...".format(self.name))
deploy_txhash = self._transact(deploy_tx)

log.info("Sending deploy transaction {} for contract {}. This may take a moment...".format(
deploy_txhash,
self.name,
))

# Wait for it to be mined
deploy_receipt = self.web3.eth.waitForTransactionReceipt(deploy_txhash)

Expand All @@ -600,7 +604,7 @@ def _deploy(self, *args, **kwargs) -> Web3Contract:
)
)

log.info("Successfully deployed {}. {}".format(self.name, deploy_txhash.hex()))
log.info("Successfully deployed {}. Transaction has been mined.".format(self.name))

self.deployments.append(Deployment(
bytecode_hash=bytecode_hash,
Expand Down

0 comments on commit e7adf15

Please sign in to comment.