diff --git a/packages/assets-controllers/src/AssetsContractController.test.ts b/packages/assets-controllers/src/AssetsContractController.test.ts index 73ab03a4a11..8df5743c3ef 100644 --- a/packages/assets-controllers/src/AssetsContractController.test.ts +++ b/packages/assets-controllers/src/AssetsContractController.test.ts @@ -1278,7 +1278,7 @@ describe('AssetsContractController', () => { it('should get the staked ethereum balance for an address', async () => { const { assetsContract, messenger, provider, networkClientConfiguration } = await setupAssetContractControllers(); - assetsContract.configure({ provider }); + assetsContract.setProvider(provider); mockNetworkWithDefaultChainId({ networkClientConfiguration, @@ -1340,7 +1340,7 @@ describe('AssetsContractController', () => { const errorSpy = jest.spyOn(console, 'error'); const { assetsContract, messenger, provider, networkClientConfiguration } = await setupAssetContractControllers(); - assetsContract.configure({ provider }); + assetsContract.setProvider(provider); mockNetworkWithDefaultChainId({ networkClientConfiguration, @@ -1387,7 +1387,7 @@ describe('AssetsContractController', () => { }); const { assetsContract, messenger, provider } = await setupAssetContractControllers(); - assetsContract.configure({ provider }); + assetsContract.setProvider(provider); const balance = await assetsContract.getStakedBalanceForChain( TEST_ACCOUNT_PUBLIC_ADDRESS, diff --git a/packages/assets-controllers/src/AssetsContractController.ts b/packages/assets-controllers/src/AssetsContractController.ts index be45ce34012..ed2532c120d 100644 --- a/packages/assets-controllers/src/AssetsContractController.ts +++ b/packages/assets-controllers/src/AssetsContractController.ts @@ -707,8 +707,8 @@ export class AssetsContractController { address: string, networkClientId?: NetworkClientId, ): Promise { - const chainId = this.getChainId(networkClientId); - const provider = this.getProvider(networkClientId); + const chainId = this.#getCorrectChainId(networkClientId); + const provider = this.#getCorrectProvider(networkClientId); // balance defaults to zero let balance: BigNumber = BigNumber.from(0); diff --git a/packages/assets-controllers/src/AssetsContractControllerWithNetworkClientId.test.ts b/packages/assets-controllers/src/AssetsContractControllerWithNetworkClientId.test.ts index 4b40dccb99a..c8395a0d642 100644 --- a/packages/assets-controllers/src/AssetsContractControllerWithNetworkClientId.test.ts +++ b/packages/assets-controllers/src/AssetsContractControllerWithNetworkClientId.test.ts @@ -905,7 +905,7 @@ describe('AssetsContractController with NetworkClientId', () => { it('should get the staked ethereum balance for an address', async () => { const { assetsContract, messenger, provider, networkClientConfiguration } = await setupAssetContractControllers(); - assetsContract.configure({ provider }); + assetsContract.setProvider(provider); mockNetworkWithDefaultChainId({ networkClientConfiguration, @@ -966,7 +966,7 @@ describe('AssetsContractController with NetworkClientId', () => { it('should default staked ethereum balance to undefined if network is not supported', async () => { const { assetsContract, provider } = await setupAssetContractControllers(); - assetsContract.configure({ provider }); + assetsContract.setProvider(provider); const balance = await assetsContract.getStakedBalanceForChain( TEST_ACCOUNT_PUBLIC_ADDRESS,