Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx-gas - add some helpful debug info to logs #5840

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/scripts/controllers/transactions/tx-gas-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ class TxGasUtil {
txMeta.simulationFails = {
reason: err.message,
errorKey: err.errorKey,
debug: { blockNumber: block.number, blockGasLimit: block.gasLimit },
}

if (err.errorKey === TRANSACTION_NO_CONTRACT_ERROR_KEY) {
txMeta.simulationFails.debug.getCodeResponse = err.getCodeResponse
}

return txMeta
}
this.setTxGas(txMeta, block.gasLimit, estimatedGasHex)
Expand Down Expand Up @@ -74,6 +80,9 @@ class TxGasUtil {
const err = new Error('TxGasUtil - Trying to call a function on a non-contract address')
// set error key so ui can display localized error message
err.errorKey = TRANSACTION_NO_CONTRACT_ERROR_KEY

// set the response on the error so that we can see in logs what the actual response was
err.getCodeResponse = code
throw err
}

Expand Down