From 6e8a39ec35123e681e47807f54ef9b9122635ea0 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 2 Jul 2021 01:42:16 -0400 Subject: [PATCH] Added Pocket back into Homestead defaultProvider and skip certain EtherscanProvider tests affected by outage. --- packages/networks/src.ts/index.ts | 14 ++++++++--- packages/tests/src.ts/test-providers.ts | 32 +++++++++---------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/packages/networks/src.ts/index.ts b/packages/networks/src.ts/index.ts index 072a4a8f69..14274bcc99 100644 --- a/packages/networks/src.ts/index.ts +++ b/packages/networks/src.ts/index.ts @@ -33,8 +33,18 @@ function ethDefaultProvider(network: string | Network): Renetworkable { } if (providers.EtherscanProvider) { + //try { + // providerList.push(new providers.EtherscanProvider(network, options.etherscan)); + //} catch(error) { } + + // These networks are currently faulty on this provider + // @TODO: This goes away once they have fixed their nodes + const skip = [ "ropsten" ]; try { - providerList.push(new providers.EtherscanProvider(network, options.etherscan)); + const provider = new providers.EtherscanProvider(network); + if (provider.network && skip.indexOf(provider.network.name) === -1) { + providerList.push(provider); + } } catch(error) { } } @@ -44,7 +54,6 @@ function ethDefaultProvider(network: string | Network): Renetworkable { } catch(error) { } } - /* if (providers.PocketProvider) { // These networks are currently faulty on Pocket as their // network does not handle the Berlin hardfork, which is @@ -58,7 +67,6 @@ function ethDefaultProvider(network: string | Network): Renetworkable { } } catch(error) { } } - */ if (providers.CloudflareProvider) { try { diff --git a/packages/tests/src.ts/test-providers.ts b/packages/tests/src.ts/test-providers.ts index 6dfd884f78..cc9973f4c5 100644 --- a/packages/tests/src.ts/test-providers.ts +++ b/packages/tests/src.ts/test-providers.ts @@ -625,7 +625,7 @@ const providerFunctions: Array = [ // @TODO: Pocket is being incredibly unreliable right now; removing it so // we can pass the CI //networks: [ "default", "homestead", "ropsten", "rinkeby", "goerli" ], - networks: [ ], + networks: [ "default", "homestead" ], create: (network: string) => { if (network == "default") { return new ethers.providers.PocketProvider(null, { @@ -743,17 +743,6 @@ Object.keys(blockchainData).forEach((network) => { return tx; }, test, (provider: string, network: string, test: TestDescription) => { - // Temporary; Pocket is having issues with old transactions on some testnets - //if ((network === "ropsten" || network === "goerli") && provider === "PocketProvider") { - if (provider === "PocketProvider") { - return true; - } - - // @TODO: Remove once Etherscan supports EIP-1559 - if (hash === "0xb8c7871d9d8597ee8a50395d8b39dafa280c90337dc501d0db1321806c6ea98c" && provider === "EtherscanProvider") { - return true; - } - return false; }); }); @@ -774,15 +763,16 @@ Object.keys(blockchainData).forEach((network) => { return receipt; }, test, (provider: string, network: string, test: TestDescription) => { - // Temporary; Pocket is having issues with old transactions on some testnets - //if ((network === "ropsten" || network === "goerli") && provider === "PocketProvider") { - if (provider === "PocketProvider") { - return true; - } - // @TODO: Remove once Etherscan supports EIP-1559 - if (hash === "0xb8c7871d9d8597ee8a50395d8b39dafa280c90337dc501d0db1321806c6ea98c" && provider === "EtherscanProvider") { - return true; + // @TODO: Remove once Etherscan fixes whatever makes this unhappy + if (provider === "EtherscanProvider") { + if (hash === "0x55c477790b105e69e98afadf0505cbda606414b0187356137132bf24945016ce") { + return true; + } + + if (hash === "0xf724f1d6813f13fb523c5f6af6261d06d41138dd094fff723e09fb0f893f03e6") { + return true; + } } return false; @@ -946,7 +936,7 @@ testFunctions.push({ networks: [ "ropsten" ], // Only test on Ropsten checkSkip: (provider: string, network: string, test: TestDescription) => { // These don't support EIP-1559 yet for sending - return (provider === "AlchemyProvider" || provider === "EtherscanProvider"); + return (provider === "AlchemyProvider"); }, execute: async (provider: ethers.providers.Provider) => { const wallet = fundWallet.connect(provider);