Skip to content

Commit

Permalink
Added Pocket back into Homestead defaultProvider and skip certain Eth…
Browse files Browse the repository at this point in the history
…erscanProvider tests affected by outage.
  • Loading branch information
ricmoo committed Jul 2, 2021
1 parent ecae793 commit 6e8a39e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
14 changes: 11 additions & 3 deletions packages/networks/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
}

Expand All @@ -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
Expand All @@ -58,7 +67,6 @@ function ethDefaultProvider(network: string | Network): Renetworkable {
}
} catch(error) { }
}
*/

if (providers.CloudflareProvider) {
try {
Expand Down
32 changes: 11 additions & 21 deletions packages/tests/src.ts/test-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ const providerFunctions: Array<ProviderDescription> = [
// @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, {
Expand Down Expand Up @@ -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;
});
});
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6e8a39e

Please sign in to comment.