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

Normalize transactions #3879

Merged
merged 5 commits into from
Apr 4, 2018
Merged

Normalize transactions #3879

merged 5 commits into from
Apr 4, 2018

Conversation

frankiebee
Copy link
Contributor

@frankiebee frankiebee commented Apr 4, 2018

Fixes #3843

@frankiebee
Copy link
Contributor Author

fixes #3843

@metamaskbot
Copy link
Collaborator

Builds ready [6ab9385]: mascara, chrome, firefox, edge, opera

_normalizeTxParams (txParams) {
delete txParams.chainId

if ( !txParams.to ) delete txParams.to
Copy link
Member

@kumavis kumavis Apr 4, 2018

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)
Copy link
Member

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()
Copy link
Member

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) {
Copy link
Member

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?

@kumavis
Copy link
Member

kumavis commented Apr 4, 2018

Awesome thanks @frankiebee !

@metamaskbot
Copy link
Collaborator

Builds ready [245c01b]: mascara, chrome, firefox, edge, opera

@kumavis kumavis merged commit bcb5f14 into master Apr 4, 2018
@kumavis kumavis deleted the normalize-transactions branch April 4, 2018 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants