chore: treeIndex as number

This commit is contained in:
Danish Arora 2025-04-02 17:33:10 +05:30
parent cad3e7afc5
commit 861a776d05
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
4 changed files with 6 additions and 6 deletions

View File

@ -476,7 +476,7 @@ export class RLNContract {
identity, identity,
membership: { membership: {
address, address,
treeIndex: `0x${membershipId}`, treeIndex: parseInt(membershipId),
chainId: network.chainId.toString(), chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber() rateLimit: decodedData.membershipRateLimit.toNumber()
} }
@ -602,7 +602,7 @@ export class RLNContract {
identity, identity,
membership: { membership: {
address, address,
treeIndex: `0x${membershipId}`, treeIndex: parseInt(membershipId),
chainId: network.chainId.toString(), chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber() rateLimit: decodedData.membershipRateLimit.toNumber()
} }

View File

@ -395,7 +395,7 @@ export class RLNLightContract {
identity, identity,
membership: { membership: {
address, address,
treeIndex: `0x${membershipId}`, treeIndex: parseInt(membershipId),
chainId: network.chainId.toString(), chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber() rateLimit: decodedData.membershipRateLimit.toNumber()
} }
@ -526,7 +526,7 @@ export class RLNLightContract {
identity, identity,
membership: { membership: {
address, address,
treeIndex: `0x${membershipId}`, treeIndex: parseInt(membershipId),
chainId: network.chainId.toString(), chainId: network.chainId.toString(),
rateLimit: decodedData.membershipRateLimit.toNumber() rateLimit: decodedData.membershipRateLimit.toNumber()
} }

View File

@ -10,7 +10,7 @@ export type Password = string | Uint8Array;
export type MembershipInfo = { export type MembershipInfo = {
chainId: string; chainId: string;
address: string; address: string;
treeIndex: `0x${string}`; // hexadecimal string treeIndex: number;
rateLimit: number; rateLimit: number;
}; };

View File

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