-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Normalize transactions #3879
Normalize transactions #3879
Conversation
fixes #3843 |
_normalizeTxParams (txParams) { | ||
delete txParams.chainId | ||
|
||
if ( !txParams.to ) delete txParams.to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use brackets when an if
has an else
@@ -185,7 +185,8 @@ module.exports = class TransactionController extends EventEmitter { | |||
|
|||
async addUnapprovedTransaction (txParams) { | |||
// validate | |||
await this.txGasUtil.validateTxParams(txParams) | |||
await this._validateTxParams(txParams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the await if we make _validateTxParams
sync
txMeta.txParams && | ||
txMeta.txParams.from | ||
) { | ||
txMeta.txParams.from = txMeta.txParams.from.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
if (txParams.gasPrice) txParams.gas = ethUtil.addHexPrefix(txParams.gas) | ||
} | ||
|
||
async _validateTxParams (txParams) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe doesnt need to be async?
Awesome thanks @frankiebee ! |
Fixes #3843