chore: chainId to be a string

This commit is contained in:
Danish Arora 2025-04-02 16:35:49 +05:30
parent 1e6e9092fa
commit 0c9ac61ae7
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
6 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import { RLN_ABI } from "./abi.js";
export const LINEA_CONTRACT = {
chainId: 59141,
chainId: "59141",
address: "0xb9cd878c90e49f797b4431fbf4fb333108cb90e6",
abi: RLN_ABI
};

View File

@ -477,7 +477,7 @@ export class RLNContract {
membership: {
address,
treeIndex: membershipId,
chainId: network.chainId,
chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber()
}
};
@ -603,7 +603,7 @@ export class RLNContract {
membership: {
address,
treeIndex: membershipId,
chainId: network.chainId,
chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber()
}
};

View File

@ -396,7 +396,7 @@ export class RLNLightContract {
membership: {
address,
treeIndex: membershipId,
chainId: network.chainId,
chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber()
}
};
@ -527,7 +527,7 @@ export class RLNLightContract {
membership: {
address,
treeIndex: membershipId,
chainId: network.chainId,
chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber()
}
};

View File

@ -8,7 +8,7 @@ export type Password = string | Uint8Array;
// see reference
// https://github.com/waku-org/nwaku/blob/f05528d4be3d3c876a8b07f9bb7dfaae8aa8ec6e/waku/waku_keystore/protocol_types.nim#L111
export type MembershipInfo = {
chainId: number;
chainId: string;
address: string;
treeIndex: number;
rateLimit: number;

View File

@ -197,7 +197,7 @@ export class RLNInstance {
}
const signer = options.signer || (await extractMetaMaskSigner());
const currentChainId = await signer.getChainId();
const currentChainId = (await signer.getChainId()).toString();
if (chainId && chainId !== currentChainId) {
throw Error(
@ -312,7 +312,7 @@ export class RLNInstance {
const chainId = credentials.membership.chainId;
const network = await this._contract.provider.getNetwork();
const currentChainId = network.chainId;
const currentChainId = network.chainId.toString();
if (chainId !== currentChainId) {
throw Error(
`Failed to verify chain coordinates: credentials chainID=${chainId} is not equal to registryContract chainID=${currentChainId}`

View File

@ -127,7 +127,7 @@ export class RLNLightInstance {
}
const signer = options.signer || (await extractMetaMaskSigner());
const currentChainId = await signer.getChainId();
const currentChainId = (await signer.getChainId()).toString();
if (chainId && chainId !== currentChainId) {
throw Error(