1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

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>
This commit is contained in:
Daniel 2022-03-04 21:20:18 +01:00 committed by GitHub
parent 261b066fc0
commit 3327c5c797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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, () => {