chore: treeIndex to be a string

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

View File

@ -470,7 +470,7 @@ export class RLNContract {
const network = await this.contract.provider.getNetwork();
const address = this.contract.address;
const membershipId = Number(decodedData.index);
const membershipId = decodedData.index.toString();
return {
identity,
@ -596,7 +596,7 @@ export class RLNContract {
const network = await this.contract.provider.getNetwork();
const address = this.contract.address;
const membershipId = ethers.BigNumber.from(decodedData.index).toNumber();
const membershipId = decodedData.index.toString();
return {
identity,

View File

@ -389,7 +389,7 @@ export class RLNLightContract {
const network = await this.contract.provider.getNetwork();
const address = this.contract.address;
const membershipId = Number(decodedData.index);
const membershipId = decodedData.index.toString();
return {
identity,
@ -520,7 +520,7 @@ export class RLNLightContract {
const network = await this.contract.provider.getNetwork();
const address = this.contract.address;
const membershipId = Number(decodedData.index);
const membershipId = decodedData.index.toString();
return {
identity,

View File

@ -10,7 +10,7 @@ export type Password = string | Uint8Array;
export type MembershipInfo = {
chainId: string;
address: string;
treeIndex: number;
treeIndex: string;
rateLimit: number;
};

View File

@ -288,7 +288,7 @@ export class RLNInstance {
return createRLNEncoder({
encoder: createEncoder(options),
rlnInstance: this,
index: credentials.membership.treeIndex,
index: parseInt(credentials.membership.treeIndex),
credential: credentials.identity
});
}