diff --git a/packages/rln/src/identity.ts b/packages/rln/src/identity.ts index 04d988c518..c18321e370 100644 --- a/packages/rln/src/identity.ts +++ b/packages/rln/src/identity.ts @@ -29,13 +29,12 @@ export class IdentityCredential { ); } - public toJSON(): Record { + public toJSON(): Record { return { idTrapdoor: Array.from(this.IDTrapdoor), idNullifier: Array.from(this.IDNullifier), idSecretHash: Array.from(this.IDSecretHash), - idCommitment: Array.from(this.IDCommitment), - idCommitmentBigInt: this.IDCommitmentBigInt.toString() + idCommitment: Array.from(this.IDCommitment) }; } } diff --git a/packages/rln/src/keystore/keystore.ts b/packages/rln/src/keystore/keystore.ts index 49eaaeca58..f3ab9bbab2 100644 --- a/packages/rln/src/keystore/keystore.ts +++ b/packages/rln/src/keystore/keystore.ts @@ -276,7 +276,7 @@ export class Keystore { treeIndex: _.get(obj, "treeIndex"), chainId: _.get(obj, "membershipContract.chainId"), address: _.get(obj, "membershipContract.address"), - rateLimit: _.get(obj, "membershipContract.rateLimit") + rateLimit: _.get(obj, "userMessageLimit") } }; } catch (err) { @@ -298,6 +298,10 @@ export class Keystore { private static fromIdentityToBytes(options: KeystoreEntity): Uint8Array { return utf8ToBytes( JSON.stringify({ + membershipContract: { + chainId: options.membership.chainId, + address: options.membership.address + }, treeIndex: options.membership.treeIndex, identityCredential: { idTrapdoor: Array.from(options.identity.IDTrapdoor), @@ -305,10 +309,7 @@ export class Keystore { idSecretHash: Array.from(options.identity.IDSecretHash), idCommitment: Array.from(options.identity.IDCommitment) }, - membershipContract: { - chainId: options.membership.chainId, - address: options.membership.address - } + userMessageLimit: options.membership.rateLimit }) ); }