Skip to content

Commit cb16272

Browse files
committed
fix: JsonRpcBatchProvider was attempting to auto-detect the network configuration for Lit's custom datil-test network, but failing because the chain ID isn't recognized in ethers.js's built-in network registry.
1 parent 0a9c772 commit cb16272

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

local-tests/setup/tinny-environment.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ export class TinnyEnvironment {
402402
async setupBareEthAuthSig() {
403403
const privateKey = await this.getAvailablePrivateKey();
404404
try {
405-
const provider = new ethers.providers.JsonRpcBatchProvider(this.rpc);
405+
const provider = new ethers.providers.StaticJsonRpcProvider({
406+
url: this.rpc,
407+
skipFetchSetup: true,
408+
});
406409
const wallet = new ethers.Wallet(privateKey.privateKey, provider);
407410

408411
const toSign = await createSiweMessage({
@@ -450,7 +453,10 @@ export class TinnyEnvironment {
450453
const privateKey = await this.getAvailablePrivateKey();
451454

452455
try {
453-
const provider = new ethers.providers.JsonRpcBatchProvider(this.rpc);
456+
const provider = new ethers.providers.StaticJsonRpcProvider({
457+
url: this.rpc,
458+
skipFetchSetup: true,
459+
});
454460
const wallet = new ethers.Wallet(privateKey.privateKey, provider);
455461

456462
const tx = await wallet.sendTransaction({
@@ -473,7 +479,10 @@ export class TinnyEnvironment {
473479
*/
474480
setupSuperCapacityDelegationAuthSig = async () => {
475481
const privateKey = await this.getAvailablePrivateKey();
476-
const provider = new ethers.providers.JsonRpcBatchProvider(this.rpc);
482+
const provider = new ethers.providers.StaticJsonRpcProvider({
483+
url: this.rpc,
484+
skipFetchSetup: true,
485+
});
477486
const wallet = new ethers.Wallet(privateKey.privateKey, provider);
478487

479488
/**
@@ -498,6 +507,7 @@ export class TinnyEnvironment {
498507
this.contractsClient = new LitContracts({
499508
signer: wallet,
500509
debug: this.processEnvs.DEBUG,
510+
rpc: this.rpc,
501511
network: this.network,
502512
});
503513
}

0 commit comments

Comments
 (0)