From 47bd579c8047d7e24c78085ee3f2d2b15fb9b0e3 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 26 Nov 2019 13:55:47 -0330 Subject: [PATCH] Add comment to addUnapprovedTransaction explaining calling _determineTransactionCategory after generateTxMeta --- app/scripts/controllers/transactions/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 9c1fc2a4e3e0..31f8cc103972 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -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,