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 <danjm.com@gmail.com>
feature/default_network_editable
Daniel 3 years ago committed by Dan Miller
parent 34bf555e50
commit d17d7f2d18
  1. 40
      app/scripts/metamask-controller.js

@ -835,24 +835,28 @@ export default class MetamaskController extends EventEmitter {
this.gasFeeController, this.gasFeeController,
), ),
}); });
this.smartTransactionsController = new SmartTransactionsController({ this.smartTransactionsController = new SmartTransactionsController(
onNetworkStateChange: this.networkController.store.subscribe.bind( {
this.networkController.store, onNetworkStateChange: this.networkController.store.subscribe.bind(
), this.networkController.store,
getNetwork: this.networkController.getNetworkState.bind( ),
this.networkController, getNetwork: this.networkController.getNetworkState.bind(
), this.networkController,
getNonceLock: this.txController.nonceTracker.getNonceLock.bind( ),
this.txController.nonceTracker, getNonceLock: this.txController.nonceTracker.getNonceLock.bind(
), this.txController.nonceTracker,
confirmExternalTransaction: this.txController.confirmExternalTransaction.bind( ),
this.txController, confirmExternalTransaction: this.txController.confirmExternalTransaction.bind(
), this.txController,
provider: this.provider, ),
trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind( provider: this.provider,
this.metaMetricsController, trackMetaMetricsEvent: this.metaMetricsController.trackEvent.bind(
), this.metaMetricsController,
}); ),
},
undefined,
initState.SmartTransactionsController,
);
// ensure accountTracker updates balances after network change // ensure accountTracker updates balances after network change
this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => { this.networkController.on(NETWORK_EVENTS.NETWORK_DID_CHANGE, () => {

Loading…
Cancel
Save