Skip to content

Commit

Permalink
fix: idCommitmnet little endianess (#86)
Browse files Browse the repository at this point in the history
* fix: idCommitmnet little endianess

* stop double conversion
  • Loading branch information
weboko authored Dec 1, 2023
1 parent 60a5070 commit 0c98a26
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/rln_contract.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { hexToBytes } from "@waku/utils/bytes";
import { ethers } from "ethers";

import { RLN_REGISTRY_ABI, RLN_STORAGE_ABI } from "./constants.js";
Expand Down Expand Up @@ -169,15 +170,11 @@ export class RLNContract {
return;
}

const idCommitment = ethers.utils.zeroPad(
ethers.utils.arrayify(_idCommitment),
32
);
const idCommitment = hexToBytes(_idCommitment?._hex);
rlnInstance.insertMember(idCommitment);
this._members.set(index.toNumber(), {
index,
idCommitment:
_idCommitment?._hex || ethers.utils.hexlify(idCommitment),
idCommitment: _idCommitment?._hex,
});
});

Expand Down

0 comments on commit 0c98a26

Please sign in to comment.