diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index a35be7709869..6576fd6ac3be 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1902,12 +1902,6 @@ export default class MetamaskController extends EventEmitter { isSimulationEnabled: () => this.preferencesController.state.useTransactionSimulations, messenger: transactionControllerMessenger, - onNetworkStateChange: (listener) => { - networkControllerMessenger.subscribe( - 'NetworkController:networkDidChange', - () => listener(), - ); - }, pendingTransactions: { isResubmitEnabled: () => { const state = this._getMetaMaskState(); @@ -2944,7 +2938,15 @@ export default class MetamaskController extends EventEmitter { this.controllerMessenger.subscribe( 'NetworkController:networkDidChange', async () => { - await this.txController.updateIncomingTransactions(); + await this.txController.updateIncomingTransactions([ + this.#getGlobalNetworkClientId(), + ]); + + await this.txController.stopIncomingTransactionPolling(); + + await this.txController.startIncomingTransactionPolling([ + this.#getGlobalNetworkClientId(), + ]); }, ); diff --git a/package.json b/package.json index 17b0cc906716..8969da582bf3 100644 --- a/package.json +++ b/package.json @@ -353,7 +353,7 @@ "@metamask/snaps-sdk": "^6.10.0", "@metamask/snaps-utils": "^8.5.2", "@metamask/solana-wallet-snap": "^0.1.9", - "@metamask/transaction-controller": "npm:@metamask-previews/transaction-controller@39.0.0-preview-e6757fdb", + "@metamask/transaction-controller": "npm:@metamask-previews/transaction-controller@39.0.0-preview-913113cf", "@metamask/user-operation-controller": "^13.0.0", "@metamask/utils": "^10.0.1", "@ngraveio/bc-ur": "^1.1.12", diff --git a/yarn.lock b/yarn.lock index ae4f48ceb3f6..c1d0b4989b48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6584,9 +6584,9 @@ __metadata: languageName: node linkType: hard -"@metamask/transaction-controller@npm:@metamask-previews/transaction-controller@39.0.0-preview-e6757fdb": - version: 39.0.0-preview-e6757fdb - resolution: "@metamask-previews/transaction-controller@npm:39.0.0-preview-e6757fdb" +"@metamask/transaction-controller@npm:@metamask-previews/transaction-controller@39.0.0-preview-913113cf": + version: 39.0.0-preview-913113cf + resolution: "@metamask-previews/transaction-controller@npm:39.0.0-preview-913113cf" dependencies: "@ethereumjs/common": "npm:^3.2.0" "@ethereumjs/tx": "npm:^4.2.0" @@ -6613,7 +6613,7 @@ __metadata: "@metamask/approval-controller": ^7.0.0 "@metamask/gas-fee-controller": ^22.0.0 "@metamask/network-controller": ^22.0.0 - checksum: 10/7a8f2ac6d13420de9f0ed1a3c1f43b88550af8af32700ba3a187136a2fdf02267e2980358667e4e82ba1e3ed9de2b1764073c9ed555d75e0251657d4954fa817 + checksum: 10/eb7714f5823c83fb6c814681a2818b4ec28ce3e09521917a76b76e8d11b35f8cc3d5a7d69355bdc66a946cbf1a5fbeb985fefc3a4f35ecb783987ba325dc5a56 languageName: node linkType: hard @@ -26773,7 +26773,7 @@ __metadata: "@metamask/solana-wallet-snap": "npm:^0.1.9" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:8.13.0" - "@metamask/transaction-controller": "npm:@metamask-previews/transaction-controller@39.0.0-preview-e6757fdb" + "@metamask/transaction-controller": "npm:@metamask-previews/transaction-controller@39.0.0-preview-913113cf" "@metamask/user-operation-controller": "npm:^13.0.0" "@metamask/utils": "npm:^10.0.1" "@ngraveio/bc-ur": "npm:^1.1.12"