From 3327c5c7979b7cf90a9ad0f29d5b7edcae4da9f0 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Fri, 4 Mar 2022 21:20:18 +0100 Subject: [PATCH] Set up STX controller state (#13843) * persist stx controller state * Pass STX controller state as the 3rd param * Trigger Build Co-authored-by: Dan Miller --- app/scripts/metamask-controller.js | 40 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c228f84dd..b7ddb2a5a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -837,24 +837,28 @@ export default class MetamaskController extends EventEmitter { this.gasFeeController, ), }); - this.smartTransactionsController = new SmartTransactionsController({ - onNetworkStateChange: this.networkController.store.subscribe.bind( - this.networkController.store, - ), - getNetwork: this.networkController.getNetworkState.bind( - this.networkController, - ), - getNonceLock: this.txController.nonceTracker.getNonceLock.bind( - this.txController.nonceTracker, - ), - confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( - this.txController, - ), - provider: this.provider, - trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( - this.metaMetricsController, - ), - }); + this.smartTransactionsController = new SmartTransactionsController( + { + onNetworkStateChange: this.networkController.store.subscribe.bind( + this.networkController.store, + ), + getNetwork: this.networkController.getNetworkState.bind( + this.networkController, + ), + getNonceLock: this.txController.nonceTracker.getNonceLock.bind( + this.txController.nonceTracker, + ), + confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( + this.txController, + ), + provider: this.provider, + trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( + this.metaMetricsController, + ), + }, + undefined, + initState.SmartTransactionsController, + ); // ensure accountTracker updates balances after network change this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {