Skip to content

Commit 631aa1d

Browse files
committed
tests: migrated all goerli tests to sepolia; contracts and config
1 parent 8220090 commit 631aa1d

File tree

8 files changed

+52
-36
lines changed

8 files changed

+52
-36
lines changed

src.ts/_tests/create-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface ProviderCreator {
2020
create: (network: string) => null | AbstractProvider;
2121
};
2222

23-
const ethNetworks = [ "default", "mainnet", "goerli" ];
23+
const ethNetworks = [ "default", "mainnet", "sepolia" ];
2424
//const maticNetworks = [ "matic", "maticmum" ];
2525

2626
const ProviderCreators: Array<ProviderCreator> = [

src.ts/_tests/test-contract.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import type { ContractEventPayload, ContractEventName, Log } from "../index.js";
1111
setupProviders();
1212

1313
describe("Test Contract", function() {
14-
const addr = "0x99417252Aad7B065940eBdF50d665Fb8879c5958";
14+
const addr = "0x24264C81146c23bbF83Db1d3F87d2111C2935Ffa";
15+
const networkName = "sepolia";
16+
1517
const abi = [
1618
"error CustomError1(uint256 code, string message)",
1719

@@ -30,7 +32,7 @@ describe("Test Contract", function() {
3032
it("tests contract calls", async function() {
3133
this.timeout(10000);
3234

33-
const provider = getProvider("InfuraProvider", "goerli");
35+
const provider = getProvider("InfuraProvider", networkName);
3436
const contract = new Contract(addr, abi, provider);
3537

3638
assert.equal(await contract.testCallAdd(4, 5), BigInt(9), "testCallAdd(4, 5)");
@@ -40,7 +42,7 @@ describe("Test Contract", function() {
4042
it("tests events", async function() {
4143
this.timeout(60000);
4244

43-
const provider = getProvider("InfuraProvider", "goerli");
45+
const provider = getProvider("InfuraProvider", networkName);
4446
assert.ok(provider);
4547

4648
const contract = new Contract(addr, abi, provider);
@@ -49,7 +51,7 @@ describe("Test Contract", function() {
4951
const contractSigner = <any>contract.connect(signer);
5052

5153
const vUint256 = 42;
52-
const vAddrName = "ethers.eth";
54+
const vAddrName = "tests.eth";
5355
const vAddr = "0x228568EA92aC5Bc281c1E30b1893735c60a139F1";
5456
const vString = "Hello";
5557
const vBytes = "0x12345678";
@@ -260,8 +262,10 @@ describe("Test Typed Contract Interaction", function() {
260262
abi.push(`function testTyped(bytes memory) public pure returns (string memory)`);
261263
abi.push(`function testTyped(string memory) public pure returns (string memory)`);
262264

263-
const addr = "0x838f41545DA5e18AA0e1ab391085d22E172B7B02";
264-
const provider = getProvider("InfuraProvider", "goerli");
265+
const addr = "0xf20ba47c47a32fc2d9ad846ff06f2fa6e89eec74";
266+
const networkName = "sepolia";
267+
268+
const provider = getProvider("InfuraProvider", networkName);
265269
const contract = new Contract(addr, abi, provider);
266270

267271
for (const { types, valueFunc } of tests) {
@@ -446,7 +450,8 @@ describe("Test Contract Fallback", function() {
446450
},
447451
];
448452

449-
const provider = getProvider("InfuraProvider", "goerli");
453+
const networkName = "sepolia";
454+
const provider = getProvider("InfuraProvider", networkName);
450455

451456
const testGroups: Array<{ group: "sendNone" | "sendData" | "sendValue" | "sendDataAndValue", tx: any }> = [
452457
{

src.ts/_tests/test-providers-avatar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ setupProviders();
66

77
describe("Resolve ENS avatar", function() {
88
[
9-
{ title: "data", name: "data-avatar.tests.ethers.eth", value: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1M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tests.ethers.eth", value: "https:/\/ethers.org/static/logo.png" },
9+
{ title: "data", name: "data-avatar.tests.eth", value: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyVpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUQ4NTEyNUIyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUQ4NTEyNUMyOEIwMTFFQzg0NTBDNTU2RDk1NTA5NzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RDg1MTI1OTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RDg1MTI1QTI4QjAxMUVDODQ1MEM1NTZEOTU1MDk3OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkbM0uMAAAAGUExURQAA/wAAAHtivz4AAAAOSURBVHjaYmDABAABBgAAFAABaEkyYwAAAABJRU5ErkJggg==" },
10+
{ title: "ipfs", name: "ipfs-avatar.tests.eth", value: "https:/\/gateway.ipfs.io/ipfs/QmQsQgpda6JAYkFoeVcj5iPbwV3xRcvaiXv3bhp1VuYUqw" },
11+
{ title: "url", name: "url-avatar.tests.eth", value: "https:/\/ethers.org/static/logo.png" },
1212
].forEach((test) => {
1313
it(`Resolves avatar for ${ test.title }`, async function() {
1414
this.timeout(60000);
15-
const provider = connect("goerli");
15+
const provider = connect("sepolia");
1616
const avatar = await provider.getAvatar(test.name);
1717
assert.equal(test.value, avatar, "avatar url");
1818
});

src.ts/_tests/test-providers-ccip.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ describe("Test CCIP execution", function() {
2323
assert.equal(result, keccak256(check), "response is equal");
2424
}
2525

26-
const address = "0x6C5ed35574a9b4d163f75bBf0595F7540D8FCc2d";
26+
const address = "0xaeaa06a37e6421ac63120d6daddee0ffa04b43e8";
27+
const networkName = "sepolia";
28+
2729
const calldata = "0x1234";
2830

2931
it("testGet passes under normal operation", async function() {
3032
this.timeout(60000);
3133

32-
const provider = connect("goerli");
34+
const provider = connect(networkName);
3335

3436
// testGet(bytes callData = "0x1234")
3537
const tx = {
@@ -44,7 +46,7 @@ describe("Test CCIP execution", function() {
4446
it("testGet should fail with CCIP not explicitly enabled by overrides", async function() {
4547
this.timeout(60000);
4648

47-
const provider = connect("goerli");
49+
const provider = connect(networkName);
4850

4951
// testGet(bytes callData = "0x1234")
5052
const tx = {
@@ -56,15 +58,19 @@ describe("Test CCIP execution", function() {
5658
const result = await provider.call(tx);
5759
console.log(result);
5860
}, (error: unknown) => {
59-
const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000";
61+
const offchainErrorData = concat([
62+
"0x556f1830000000000000000000000000",
63+
address,
64+
"0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000"
65+
]);
6066
return (isCallException(error) && error.data === offchainErrorData);
6167
});
6268
});
6369

6470
it("testGet should fail with CCIP explicitly disabled on provider", async function() {
6571
this.timeout(60000);
6672

67-
const provider = connect("goerli");
73+
const provider = connect(networkName);
6874
provider.disableCcipRead = true;
6975

7076
// testGetFail(bytes callData = "0x1234")
@@ -77,15 +83,20 @@ describe("Test CCIP execution", function() {
7783
const result = await provider.call(tx);
7884
console.log(result);
7985
}, (error: unknown) => {
80-
const offchainErrorData = "0x556f18300000000000000000000000006c5ed35574a9b4d163f75bbf0595f7540d8fcc2d00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000";
86+
const offchainErrorData = concat([
87+
"0x556f1830000000000000000000000000",
88+
address,
89+
"0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140b1494be100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f6574686572732e7269636d6f6f2e776f726b6572732e6465762f746573742d636369702d726561642f7b73656e6465727d2f7b646174617d00000000000000000000000000000000000000000000000000000000000000021234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d4d79206578747261206461746100000000000000000000000000000000000000"
90+
]);
91+
8192
return (isCallException(error) && error.data === offchainErrorData);
8293
});
8394
});
8495

8596
it("testGetFail should fail if all URLs 5xx", async function() {
8697
this.timeout(60000);
8798

88-
const provider = connect("goerli");
99+
const provider = connect(networkName);
89100

90101
// testGetFail(bytes callData = "0x1234")
91102
const tx = {
@@ -106,7 +117,7 @@ describe("Test CCIP execution", function() {
106117
it("testGetSenderFail should fail if sender does not match", async function() {
107118
this.timeout(60000);
108119

109-
const provider = connect("goerli");
120+
const provider = connect(networkName);
110121

111122
// testGetSenderFail(bytes callData = "0x1234")
112123
const tx = {
@@ -131,7 +142,7 @@ describe("Test CCIP execution", function() {
131142
it("testGetMissing should fail if early URL 4xx", async function() {
132143
this.timeout(60000);
133144

134-
const provider = connect("goerli");
145+
const provider = connect(networkName);
135146

136147
// testGetMissing(bytes callData = "0x1234")
137148
const tx = {
@@ -153,7 +164,7 @@ describe("Test CCIP execution", function() {
153164
it("testGetFallback passes if any URL returns correctly", async function() {
154165
this.timeout(60000);
155166

156-
const provider = connect("goerli");
167+
const provider = connect(networkName);
157168

158169
// testGetFallback(bytes callData = "0x1234")
159170
const tx = {
@@ -168,7 +179,7 @@ describe("Test CCIP execution", function() {
168179
it("testPost passes under normal operation", async function() {
169180
this.timeout(60000);
170181

171-
const provider = connect("goerli");
182+
const provider = connect(networkName);
172183

173184
// testPost(bytes callData = "0x1234")
174185
const tx = {

src.ts/_tests/test-providers-data.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ describe("Test Provider Transaction operations", function() {
244244

245245
describe("Test Networks", function() {
246246
const networks = [
247-
"mainnet", "goerli", "sepolia", "holesky",
248-
"arbitrum", "arbitrum-goerli", "arbitrum-sepolia",
249-
"base", "base-goerli", "base-sepolia",
247+
"mainnet", "sepolia", "holesky",
248+
"arbitrum", "arbitrum-sepolia",
249+
"base", "base-sepolia",
250250
"bnb", "bnbt",
251-
"linea", "linea-goerli",
252-
"matic", "matic-mumbai",
253-
"optimism", "optimism-goerli", "optimism-sepolia",
251+
"linea", "linea-sepolia",
252+
"matic", "matic-mumbai", "matic-amoy",
253+
"optimism", "optimism-sepolia",
254254
"xdai",
255255
];
256256

src.ts/_tests/test-providers-errors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ describe("Tests Provider Call Exception", function() {
4242
//{ code: 0x51, reason: "UNINITIALIZED_FUNCTION_CALL" },
4343
];
4444

45-
const testAddr = "0xF20Ba47c47a32fc2d9ad846fF06f2fa6e89eeC74";
45+
const testAddr = "0x86d19fF4b2EB0D451511B5B930b01DC71fD9a2Ee";
46+
const networkName = "sepolia";
4647

47-
const networkName = "goerli";
4848
for (const { code, reason } of panics) {
4949
for (const method of [ "call", "estimateGas" ]) {
5050
for (const providerName of providerNames) {
@@ -166,7 +166,7 @@ describe("Tests Provider Call Exception", function() {
166166
describe("Test Provider Blockchain Errors", function() {
167167
const wallet = new Wallet(<string>(process.env.FAUCET_PRIVATEKEY));
168168

169-
const networkName = "goerli";
169+
const networkName = "sepolia";
170170
for (const providerName of providerNames) {
171171

172172
const provider = getProvider(providerName, networkName);

src.ts/_tests/test-providers-send.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("Sends Transactions", function() {
1717
const wallet = new Wallet(<string>(process.env.FAUCET_PRIVATEKEY));
1818
console.log("Faucet Address:", wallet.address);
1919

20-
const networkName = "goerli";
20+
const networkName = "sepolia";
2121
for (const providerName of providerNames) {
2222
const provider = getProvider(providerName, networkName);
2323
if (provider == null) { continue; }

src.ts/_tests/test-providers-wildcard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import { connect, setupProviders } from "./create-provider.js";
55
setupProviders();
66

77
describe("Test EIP-2544 ENS wildcards", function() {
8-
const provider = connect("goerli");
8+
const provider = connect("sepolia");
99

1010
it("Resolves recursively", async function() {
1111
this.timeout(10000);
1212

1313
const resolver = await provider.getResolver("ricmoose.hatch.eth");
1414
assert.ok(resolver, "failed to get resolver");
1515

16-
assert.equal(resolver.address, "0x15abA1fa74Bfdecd63A71218DC632d4328Db8168", "address");
16+
assert.equal(resolver.address, "0x657D81B1E647A56457ff035Af22898411673f7FD", "address");
1717
assert.equal(await resolver.supportsWildcard(), true, "supportsWildcard()");
1818

1919
// Test pass-through avatar
2020
assert.equal(await resolver.getAvatar(), "https:/\/static.ricmoo.com/uploads/profile-06cb9c3031c9.jpg", "getAvatar()");
2121

22-
assert.equal(await resolver.getAddress(), "0x4B711A377B1b3534749FBe5e59Bcf7F94d92EA98", "getAddress()");
22+
assert.equal(await resolver.getAddress(), "0xF0d6e3fC0f5A23aAAA4933700438b6313Dd331bD", "getAddress()");
2323
});
2424
});
2525

0 commit comments

Comments
 (0)