mirror of
https://github.com/waku-org/examples.waku.org.git
synced 2025-02-22 10:48:22 +00:00
find a shorter way to convert endianness
This commit is contained in:
parent
bc4548d6f5
commit
2e8a28acb2
@ -297,12 +297,6 @@
|
|||||||
updateFields();
|
updateFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeEndianess = (hex) => {
|
|
||||||
const bytes = ethers.utils.arrayify(hex);
|
|
||||||
const reversed = bytes.reverse();
|
|
||||||
return ethers.utils.hexlify(reversed);
|
|
||||||
};
|
|
||||||
|
|
||||||
const checkChain = async (chainId) => {
|
const checkChain = async (chainId) => {
|
||||||
retrieveRLNDetailsButton.disabled = retrievedRLNEvents || chainId !== 5;
|
retrieveRLNDetailsButton.disabled = retrievedRLNEvents || chainId !== 5;
|
||||||
registerButton.disabled = !(chainId === 5 && retrievedRLNEvents);
|
registerButton.disabled = !(chainId === 5 && retrievedRLNEvents);
|
||||||
@ -406,8 +400,9 @@
|
|||||||
try {
|
try {
|
||||||
registerButton.disabled = true;
|
registerButton.disabled = true;
|
||||||
|
|
||||||
const _pubkey = ethers.BigNumber.from(membershipKey.IDCommitment);
|
const idCommitment = membershipKey.IDCommitment;
|
||||||
const pubkey = changeEndianess(_pubkey.toHexString());
|
const reversedArray = idCommitment.slice().reverse();
|
||||||
|
const pubkey = ethers.utils.hexlify(reversedArray).toString();
|
||||||
|
|
||||||
const price = await rlnContract.MEMBERSHIP_DEPOSIT();
|
const price = await rlnContract.MEMBERSHIP_DEPOSIT();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user