Skip to content

Commit 449ad34

Browse files
use ENS in test:prepare script (prevent breaking test when ENS change)
1 parent c18296e commit 449ad34

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

tests/scripts/prepare-bellecour-fork-for-tests.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import {
22
Contract,
3+
EnsPlugin,
34
JsonRpcProvider,
45
JsonRpcSigner,
6+
Network,
57
formatEther,
68
keccak256,
79
toBeHex,
@@ -17,15 +19,27 @@ const LEARN_WORKERPOOL_OWNER_WALLET =
1719
const PROD_WORKERPOOL_OWNER_WALLET =
1820
'0x1Ff6AfF580e8Ca738F76485E0914C2aCaDa7B462';
1921
const APP_OWNER_WALLET = '0x626D65C778fB98f813C25F84249E3012B80e8d91';
20-
const LEARN_WORKERPOOL = '0x0975bfce90f4748dab6d6729c96b33a2cd5491f5'; // 'prod-v8-learn.main.pools.iexec.eth';
21-
const PROD_WORKERPOOL = '0x0e7bc972c99187c191a17f3cae4a2711a4188c3f'; // 'prod-v8-bellecour.main.pools.iexec.eth';
22-
const WEB3_MAIL_DAPP_ADDRESS = '0x3d9d7600b6128c03b7ddbf050934e7ecfe0c61c8'; // 'web3mail.apps.iexec.eth';
22+
const LEARN_WORKERPOOL_ENS = 'prod-v8-learn.main.pools.iexec.eth';
23+
const PROD_WORKERPOOL_ENS = 'prod-v8-bellecour.main.pools.iexec.eth';
24+
const WEB3_MAIL_DAPP_ADDRESS_ENS = 'web3mail.apps.iexec.eth';
2325

2426
const rpcURL = DRONE ? 'http://bellecour-fork:8545' : 'http://127.0.0.1:8545';
2527

26-
const provider = new JsonRpcProvider(rpcURL, undefined, {
27-
pollingInterval: 1000, // speed up tests
28-
});
28+
const provider = new JsonRpcProvider(
29+
rpcURL,
30+
new Network('bellecour-fork', 134).attachPlugin(
31+
new EnsPlugin('0x5f5B93fca68c9C79318d1F3868A354EE67D8c006', 134)
32+
),
33+
{
34+
pollingInterval: 1000, // speed up tests
35+
}
36+
);
37+
38+
const LEARN_WORKERPOOL = await provider.resolveName(LEARN_WORKERPOOL_ENS);
39+
const PROD_WORKERPOOL = await provider.resolveName(PROD_WORKERPOOL_ENS);
40+
const WEB3_MAIL_DAPP_ADDRESS = await provider.resolveName(
41+
WEB3_MAIL_DAPP_ADDRESS_ENS
42+
);
2943

3044
const setBalance = async (address, weiAmount) => {
3145
fetch(rpcURL, {

0 commit comments

Comments
 (0)