From 1d885651bd0eea0bd254545a2161396cf310b7bd Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 14 Apr 2023 16:13:16 -0230 Subject: [PATCH] Make `refreshNetwork` async (#1182) The internal method `refreshNetwork` has been made async. The method already called an asynchronous method internally, but it was not `await`-ed. Now it is. This method is only being called from within synchronous functions. They will be made async in later PRs. Because the async call was the last operation, this change effectively has no functional impact. This relates to https://github.com/MetaMask/core/issues/1176 --- packages/network-controller/src/NetworkController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index 94e2c0cc55b..182a35293ef 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -288,14 +288,14 @@ export class NetworkController extends BaseControllerV2< }; } - private refreshNetwork() { + private async refreshNetwork() { this.update((state) => { state.network = 'loading'; state.networkDetails = {}; }); const { rpcTarget, type, chainId, ticker } = this.state.providerConfig; this.configureProvider(type, rpcTarget, chainId, ticker); - this.lookupNetwork(); + await this.lookupNetwork(); } private registerProvider() {