mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-10 01:23:05 +00:00
debugging: switch echo to trace
This commit is contained in:
parent
a4fd152c8c
commit
6faab82ca9
@ -254,8 +254,8 @@ proc confirm*(tx: Future[?TransactionResponse],
|
||||
|
||||
let receipt = await response.confirm(confirmations, timeout)
|
||||
|
||||
echo "[ether/contract.confirm] receipt.status: ", receipt.status
|
||||
if receipt.status != TransactionStatus.Success:
|
||||
trace "transaction failed", status = receipt.status
|
||||
without blockNumber =? receipt.blockNumber:
|
||||
raiseContractError "Transaction reverted with unknown reason"
|
||||
|
||||
@ -264,8 +264,11 @@ proc confirm*(tx: Future[?TransactionResponse],
|
||||
raiseContractError "Transaction reverted with unknown reason"
|
||||
|
||||
try:
|
||||
trace "replaying transaction to get revert reason"
|
||||
await provider.replay(transaction, blockNumber)
|
||||
trace "transaction replay completed, no revert reason obtained"
|
||||
except ProviderError as e:
|
||||
trace "transaction revert reason obtained", reason = e.msg
|
||||
# should contain the revert reason
|
||||
raiseContractError e.msg
|
||||
|
||||
|
||||
@ -43,12 +43,12 @@ template convertError(nonce = none UInt256, body) =
|
||||
try:
|
||||
body
|
||||
except JsonRpcError as error:
|
||||
echo "[jsonrpc.convertError] error encountered (nonce: ", nonce, "): ", error.msg
|
||||
trace "jsonrpc error", nonce, error = error.msg
|
||||
raiseProviderError(error.msg, nonce)
|
||||
# Catch all ValueErrors for now, at least until JsonRpcError is actually
|
||||
# raised. PR created: https://github.com/status-im/nim-json-rpc/pull/151
|
||||
except ValueError as error:
|
||||
echo "[jsonrpc.convertError] error encountered (nonce: ", nonce, "): ", error.msg
|
||||
trace "jsonrpc error (from rpc client)", nonce, error = error.msg
|
||||
raiseProviderError(error.msg, nonce)
|
||||
|
||||
template convertError(body) =
|
||||
@ -268,5 +268,5 @@ method sendTransaction*(signer: JsonRpcSigner,
|
||||
client = await signer.provider.client
|
||||
hash = await client.eth_sendTransaction(transaction)
|
||||
|
||||
echo "[jsonrpc.sendTransaction] RESPONSE send transaction -- nonce: ", transaction.nonce, ", hash: ", hash.to0xHex
|
||||
trace "jsonrpc sendTransaction RESPONSE", nonce = transaction.nonce, hash = hash.to0xHex
|
||||
return TransactionResponse(hash: hash, provider: signer.provider)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user