From 59a73a64cc7f5f0427076465534b3a33662da312 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 22 Jun 2021 16:04:45 +0530 Subject: [PATCH] specific error on tooltip --- apps/remix-ide/src/app/tabs/hardhat-provider.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remix-ide/src/app/tabs/hardhat-provider.js b/apps/remix-ide/src/app/tabs/hardhat-provider.js index 88fe3b7c85..8c2cd0ae05 100644 --- a/apps/remix-ide/src/app/tabs/hardhat-provider.js +++ b/apps/remix-ide/src/app/tabs/hardhat-provider.js @@ -59,6 +59,9 @@ export default class HardhatProvider extends Plugin { sendAsyncInternal (data, resolve, reject) { if (this.provider) { + // Check the case where current environment is VM on UI and it still sends RPC requests + // This will be displayed on UI tooltip as 'cannot get account list: Environment Updated !!' + if (this.blockchain.getProvider() !== 'Hardhat Provider' && data.method !== 'net_listening') return reject(new Error('Environment Updated !!')) this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](data, (error, message) => { if (error) { this.provider = null