diff --git a/src.ts/_tests/create-provider.ts b/src.ts/_tests/create-provider.ts index 2d792547a..1a9b71f32 100644 --- a/src.ts/_tests/create-provider.ts +++ b/src.ts/_tests/create-provider.ts @@ -20,7 +20,7 @@ interface ProviderCreator { create: (network: string) => null | AbstractProvider; }; -const ethNetworks = [ "default", "mainnet", "goerli" ]; +const ethNetworks = [ "default", "mainnet", "sepolia" ]; //const maticNetworks = [ "matic", "maticmum" ]; const ProviderCreators: Array = [ diff --git a/src.ts/_tests/test-contract.ts b/src.ts/_tests/test-contract.ts index 2675a046a..cbdd8d243 100644 --- a/src.ts/_tests/test-contract.ts +++ b/src.ts/_tests/test-contract.ts @@ -11,7 +11,9 @@ import type { ContractEventPayload, ContractEventName, Log } from "../index.js"; setupProviders(); describe("Test Contract", function() { - const addr = "0x99417252Aad7B065940eBdF50d665Fb8879c5958"; + const addr = "0x24264C81146c23bbF83Db1d3F87d2111C2935Ffa"; + const networkName = "sepolia"; + const abi = [ "error CustomError1(uint256 code, string message)", @@ -30,7 +32,7 @@ describe("Test Contract", function() { it("tests contract calls", async function() { this.timeout(10000); - const provider = getProvider("InfuraProvider", "goerli"); + const provider = getProvider("InfuraProvider", networkName); const contract = new Contract(addr, abi, provider); assert.equal(await contract.testCallAdd(4, 5), BigInt(9), "testCallAdd(4, 5)"); @@ -40,7 +42,7 @@ describe("Test Contract", function() { it("tests events", async function() { this.timeout(60000); - const provider = getProvider("InfuraProvider", "goerli"); + const provider = getProvider("InfuraProvider", networkName); assert.ok(provider); const contract = new Contract(addr, abi, provider); @@ -49,7 +51,7 @@ describe("Test Contract", function() { const contractSigner = contract.connect(signer); const vUint256 = 42; - const vAddrName = "ethers.eth"; + const vAddrName = "tests.eth"; const vAddr = "0x228568EA92aC5Bc281c1E30b1893735c60a139F1"; const vString = "Hello"; const vBytes = "0x12345678"; @@ -260,8 +262,10 @@ describe("Test Typed Contract Interaction", function() { abi.push(`function testTyped(bytes memory) public pure returns (string memory)`); abi.push(`function testTyped(string memory) public pure returns (string memory)`); - const addr = "0x838f41545DA5e18AA0e1ab391085d22E172B7B02"; - const provider = getProvider("InfuraProvider", "goerli"); + const addr = "0xf20ba47c47a32fc2d9ad846ff06f2fa6e89eec74"; + const networkName = "sepolia"; + + const provider = getProvider("InfuraProvider", networkName); const contract = new Contract(addr, abi, provider); for (const { types, valueFunc } of tests) { @@ -446,7 +450,8 @@ describe("Test Contract Fallback", function() { }, ]; - const provider = getProvider("InfuraProvider", "goerli"); + const networkName = "sepolia"; + const provider = getProvider("InfuraProvider", networkName); const testGroups: Array<{ group: "sendNone" | "sendData" | "sendValue" | "sendDataAndValue", tx: any }> = [ { diff --git a/src.ts/_tests/test-providers-avatar.ts b/src.ts/_tests/test-providers-avatar.ts index 4a26a8371..749adf744 100644 --- a/src.ts/_tests/test-providers-avatar.ts +++ b/src.ts/_tests/test-providers-avatar.ts @@ -6,13 +6,13 @@ setupProviders(); describe("Resolve ENS avatar", function() { [ - { title: "data", name: "data-avatar.tests.ethers.eth", value: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUQ4NTEyNUIyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUQ4NTEyNUMyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RDg1MTI1OTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RDg1MTI1QTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkbM0uMAAAAGUExURQAA/wAAAHtivz4AAAAOSURBVHjaYmDABAABBgAAFAABaEkyYwAAAABJRU5ErkJggg==" }, - { title: "ipfs", name: "ipfs-avatar.tests.ethers.eth", value: "https:/\/gateway.ipfs.io/ipfs/QmQsQgpda6JAYkFoeVcj5iPbwV3xRcvaiXv3bhp1VuYUqw" }, - { title: "url", name: "url-avatar.tests.ethers.eth", value: "https:/\/ethers.org/static/logo.png" }, + { title: "data", name: "data-avatar.tests.eth", value: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyVpVFh0WE1MOmNvbS5h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0IGVuZD0iciI/PkbM0uMAAAAGUExURQAA/wAAAHtivz4AAAAOSURBVHjaYmDABAABBgAAFAABaEkyYwAAAABJRU5ErkJggg==" }, + { title: "ipfs", name: "ipfs-avatar.tests.eth", value: "https:/\/gateway.ipfs.io/ipfs/QmQsQgpda6JAYkFoeVcj5iPbwV3xRcvaiXv3bhp1VuYUqw" }, + { title: "url", name: "url-avatar.tests.eth", value: "https:/\/ethers.org/static/logo.png" }, ].forEach((test) => { it(`Resolves avatar for ${ test.title }`, async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect("sepolia"); const avatar = await provider.getAvatar(test.name); assert.equal(test.value, avatar, "avatar url"); }); diff --git a/src.ts/_tests/test-providers-ccip.ts b/src.ts/_tests/test-providers-ccip.ts index f6ef6a571..49aba46f9 100644 --- a/src.ts/_tests/test-providers-ccip.ts +++ b/src.ts/_tests/test-providers-ccip.ts @@ -23,13 +23,15 @@ describe("Test CCIP execution", function() { assert.equal(result, keccak256(check), "response is equal"); } - const address = "0x6C5ed35574a9b4d163f75bBf0595F7540D8FCc2d"; + const address = "0xaeaa06a37e6421ac63120d6daddee0ffa04b43e8"; + const networkName = "sepolia"; + const calldata = "0x1234"; it("testGet passes under normal operation", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGet(bytes callData = "0x1234") const tx = { @@ -44,7 +46,7 @@ describe("Test CCIP execution", function() { it("testGet should fail with CCIP not explicitly enabled by overrides", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGet(bytes callData = "0x1234") const tx = { @@ -56,7 +58,11 @@ describe("Test CCIP execution", function() { const result = await provider.call(tx); console.log(result); }, (error: unknown) => { - const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000"; + const offchainErrorData = concat([ + "0x556f1830000000000000000000000000", + address, + "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000" + ]); return (isCallException(error) && error.data === offchainErrorData); }); }); @@ -64,7 +70,7 @@ describe("Test CCIP execution", function() { it("testGet should fail with CCIP explicitly disabled on provider", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); provider.disableCcipRead = true; // testGetFail(bytes callData = "0x1234") @@ -77,7 +83,12 @@ describe("Test CCIP execution", function() { const result = await provider.call(tx); console.log(result); }, (error: unknown) => { - const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000"; + const offchainErrorData = concat([ + "0x556f1830000000000000000000000000", + address, + "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000" + ]); + return (isCallException(error) && error.data === offchainErrorData); }); }); @@ -85,7 +96,7 @@ describe("Test CCIP execution", function() { it("testGetFail should fail if all URLs 5xx", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGetFail(bytes callData = "0x1234") const tx = { @@ -106,7 +117,7 @@ describe("Test CCIP execution", function() { it("testGetSenderFail should fail if sender does not match", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGetSenderFail(bytes callData = "0x1234") const tx = { @@ -131,7 +142,7 @@ describe("Test CCIP execution", function() { it("testGetMissing should fail if early URL 4xx", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGetMissing(bytes callData = "0x1234") const tx = { @@ -153,7 +164,7 @@ describe("Test CCIP execution", function() { it("testGetFallback passes if any URL returns correctly", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testGetFallback(bytes callData = "0x1234") const tx = { @@ -168,7 +179,7 @@ describe("Test CCIP execution", function() { it("testPost passes under normal operation", async function() { this.timeout(60000); - const provider = connect("goerli"); + const provider = connect(networkName); // testPost(bytes callData = "0x1234") const tx = { diff --git a/src.ts/_tests/test-providers-data.ts b/src.ts/_tests/test-providers-data.ts index 0803d02e7..1777e685a 100644 --- a/src.ts/_tests/test-providers-data.ts +++ b/src.ts/_tests/test-providers-data.ts @@ -244,13 +244,13 @@ describe("Test Provider Transaction operations", function() { describe("Test Networks", function() { const networks = [ - "mainnet", "goerli", "sepolia", "holesky", - "arbitrum", "arbitrum-goerli", "arbitrum-sepolia", - "base", "base-goerli", "base-sepolia", + "mainnet", "sepolia", "holesky", + "arbitrum", "arbitrum-sepolia", + "base", "base-sepolia", "bnb", "bnbt", - "linea", "linea-goerli", - "matic", "matic-mumbai", - "optimism", "optimism-goerli", "optimism-sepolia", + "linea", "linea-sepolia", + "matic", "matic-mumbai", "matic-amoy", + "optimism", "optimism-sepolia", "xdai", ]; diff --git a/src.ts/_tests/test-providers-errors.ts b/src.ts/_tests/test-providers-errors.ts index 43fecac3a..961e30194 100644 --- a/src.ts/_tests/test-providers-errors.ts +++ b/src.ts/_tests/test-providers-errors.ts @@ -42,9 +42,9 @@ describe("Tests Provider Call Exception", function() { //{ code: 0x51, reason: "UNINITIALIZED_FUNCTION_CALL" }, ]; - const testAddr = "0xF20Ba47c47a32fc2d9ad846fF06f2fa6e89eeC74"; + const testAddr = "0x86d19fF4b2EB0D451511B5B930b01DC71fD9a2Ee"; + const networkName = "sepolia"; - const networkName = "goerli"; for (const { code, reason } of panics) { for (const method of [ "call", "estimateGas" ]) { for (const providerName of providerNames) { @@ -166,7 +166,7 @@ describe("Tests Provider Call Exception", function() { describe("Test Provider Blockchain Errors", function() { const wallet = new Wallet((process.env.FAUCET_PRIVATEKEY)); - const networkName = "goerli"; + const networkName = "sepolia"; for (const providerName of providerNames) { const provider = getProvider(providerName, networkName); diff --git a/src.ts/_tests/test-providers-send.ts b/src.ts/_tests/test-providers-send.ts index ac5dd1966..e31215bfe 100644 --- a/src.ts/_tests/test-providers-send.ts +++ b/src.ts/_tests/test-providers-send.ts @@ -17,7 +17,7 @@ describe("Sends Transactions", function() { const wallet = new Wallet((process.env.FAUCET_PRIVATEKEY)); console.log("Faucet Address:", wallet.address); - const networkName = "goerli"; + const networkName = "sepolia"; for (const providerName of providerNames) { const provider = getProvider(providerName, networkName); if (provider == null) { continue; } diff --git a/src.ts/_tests/test-providers-wildcard.ts b/src.ts/_tests/test-providers-wildcard.ts index 182ad36a1..0d75e89ad 100644 --- a/src.ts/_tests/test-providers-wildcard.ts +++ b/src.ts/_tests/test-providers-wildcard.ts @@ -5,7 +5,7 @@ import { connect, setupProviders } from "./create-provider.js"; setupProviders(); describe("Test EIP-2544 ENS wildcards", function() { - const provider = connect("goerli"); + const provider = connect("sepolia"); it("Resolves recursively", async function() { this.timeout(10000); @@ -13,13 +13,13 @@ describe("Test EIP-2544 ENS wildcards", function() { const resolver = await provider.getResolver("ricmoose.hatch.eth"); assert.ok(resolver, "failed to get resolver"); - assert.equal(resolver.address, "0x15abA1fa74Bfdecd63A71218DC632d4328Db8168", "address"); + assert.equal(resolver.address, "0x657D81B1E647A56457ff035Af22898411673f7FD", "address"); assert.equal(await resolver.supportsWildcard(), true, "supportsWildcard()"); // Test pass-through avatar assert.equal(await resolver.getAvatar(), "https:/\/static.ricmoo.com/uploads/profile-06cb9c3031c9.jpg", "getAvatar()"); - assert.equal(await resolver.getAddress(), "0x4B711A377B1b3534749FBe5e59Bcf7F94d92EA98", "getAddress()"); + assert.equal(await resolver.getAddress(), "0xF0d6e3fC0f5A23aAAA4933700438b6313Dd331bD", "getAddress()"); }); });