Skip to content

Commit

Permalink
Add comment to addUnapprovedTransaction explaining calling _determine…
Browse files Browse the repository at this point in the history
…TransactionCategory after generateTxMeta
  • Loading branch information
danjm committed Nov 26, 2019
1 parent ccd7e62 commit 47bd579
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ class TransactionController extends EventEmitter {
throw new Error(`Transaction from address isn't valid for this account`)
}
txUtils.validateTxParams(normalizedTxParams)
// construct txMeta
/**
`generateTxMeta` adds the default txMeta properties to the passed object.
These include the tx's `id`. As we use the id for determining order of
txes in the tx-state-manager, it is necessary to call the asynchronous
method `this._determineTransactionCategory` after `generateTxMeta`.
*/
let txMeta = this.txStateManager.generateTxMeta({
txParams: normalizedTxParams,
type: TRANSACTION_TYPE_STANDARD,
Expand Down

0 comments on commit 47bd579

Please sign in to comment.