mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 18:41:38 +01:00
A more expressive way
replaced ifs with ? :
This commit is contained in:
parent
7854321fae
commit
553d713636
@ -201,11 +201,8 @@ module.exports = class TransactionController extends EventEmitter {
|
|||||||
// wait for a nonce
|
// wait for a nonce
|
||||||
nonceLock = await this.nonceTracker.getNonceLock(fromAddress)
|
nonceLock = await this.nonceTracker.getNonceLock(fromAddress)
|
||||||
// add nonce to txParams
|
// add nonce to txParams
|
||||||
if (txMeta.nonceSpecified) {
|
const nonce = txMeta.nonceSpecified ? txMeta.txParams.nonce : nonceLock.nextNonce
|
||||||
txMeta.txParams.nonce = ethUtil.addHexPrefix(txMeta.txParams.nonce.toString(16))
|
txMeta.txParams.nonce = ethUtil.addHexPrefix(nonce.toString(16))
|
||||||
} else {
|
|
||||||
txMeta.txParams.nonce = ethUtil.addHexPrefix(nonceLock.nextNonce.toString(16))
|
|
||||||
}
|
|
||||||
// add nonce debugging information to txMeta
|
// add nonce debugging information to txMeta
|
||||||
txMeta.nonceDetails = nonceLock.nonceDetails
|
txMeta.nonceDetails = nonceLock.nonceDetails
|
||||||
this.txStateManager.updateTx(txMeta, 'transactions#approveTransaction')
|
this.txStateManager.updateTx(txMeta, 'transactions#approveTransaction')
|
||||||
|
Loading…
Reference in New Issue
Block a user