chore: change endianess on idCommitment

ref: waku-org/js-rln#37
This commit is contained in:
danisharora099 2022-12-23 18:38:08 +05:30
parent 010d328942
commit bc4548d6f5
No known key found for this signature in database
GPG Key ID: FBD2BF500037F135

View File

@ -297,6 +297,12 @@
updateFields();
};
const changeEndianess = (hex) => {
const bytes = ethers.utils.arrayify(hex);
const reversed = bytes.reverse();
return ethers.utils.hexlify(reversed);
};
const checkChain = async (chainId) => {
retrieveRLNDetailsButton.disabled = retrievedRLNEvents || chainId !== 5;
registerButton.disabled = !(chainId === 5 && retrievedRLNEvents);
@ -400,7 +406,8 @@
try {
registerButton.disabled = true;
const pubkey = ethers.BigNumber.from(membershipKey.IDCommitment);
const _pubkey = ethers.BigNumber.from(membershipKey.IDCommitment);
const pubkey = changeEndianess(_pubkey.toHexString());
const price = await rlnContract.MEMBERSHIP_DEPOSIT();