From d9f45b3b9db92c72f9c606bab8315d0eb02fec70 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Sun, 1 May 2022 02:05:22 -0400 Subject: [PATCH] Added testnets for AnkrProvider (#2949, #2950). --- packages/providers/src.ts/ankr-provider.ts | 8 ++++++++ packages/tests/src.ts/test-providers.ts | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/providers/src.ts/ankr-provider.ts b/packages/providers/src.ts/ankr-provider.ts index eb454773c..844322f04 100644 --- a/packages/providers/src.ts/ankr-provider.ts +++ b/packages/providers/src.ts/ankr-provider.ts @@ -17,8 +17,16 @@ function getHost(name: string): string { switch (name) { case "homestead": return "rpc.ankr.com/eth/"; + case "ropsten": + return "rpc.ankr.com/eth_ropsten/"; + case "rinkeby": + return "rpc.ankr.com/eth_rinkeby/"; + case "goerli": + return "rpc.ankr.com/eth_goerli/"; + case "matic": return "rpc.ankr.com/polygon/"; + case "arbitrum": return "rpc.ankr.com/arbitrum/"; } diff --git a/packages/tests/src.ts/test-providers.ts b/packages/tests/src.ts/test-providers.ts index d6c1f5a0e..0cd84c9e5 100644 --- a/packages/tests/src.ts/test-providers.ts +++ b/packages/tests/src.ts/test-providers.ts @@ -113,7 +113,7 @@ const blockchainData: { [ network: string ]: TestCases } = { } ], logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000", - root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", + //root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", status: null, to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", @@ -351,7 +351,7 @@ const blockchainData: { [ network: string ]: TestCases } = { } ], logsBloom: "0x00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000010000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - root: "0xf1c3506ab619ac1b5e8f1ca355b16d6b9a1b7436b2960b0e9ec9a91f4238b5cc", + //root: "0xf1c3506ab619ac1b5e8f1ca355b16d6b9a1b7436b2960b0e9ec9a91f4238b5cc", to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c", transactionHash: "0x55c477790b105e69e98afadf0505cbda606414b0187356137132bf24945016ce", transactionIndex: 0x0 @@ -585,7 +585,7 @@ const providerFunctions: Array = [ }, { name: "AnkrProvider", - networks: [ "default", "homestead" ], + networks: [ "default", "homestead", "ropsten", "rinkeby" ], create: (network: string) => { if (network == "default") { return new ethers.providers.AnkrProvider(null); @@ -763,6 +763,7 @@ Object.keys(blockchainData).forEach((network) => { const hash = test.transactionHash; addObjectTest(`fetches transaction receipt ${ hash }`, async (provider: ethers.providers.Provider) => { const receipt = await provider.getTransactionReceipt(hash); + assert.ok(!!receipt, "missing receipt"); if (test.status === null) { assert.ok(receipt.status === undefined, "no status");