mirror of
https://github.com/logos-messaging/js-rln.git
synced 2026-01-07 16:13:07 +00:00
fix: idCommitmnet little endianess (#86)
* fix: idCommitmnet little endianess * stop double conversion
This commit is contained in:
parent
60a50709c7
commit
0c98a266e2
@ -1,3 +1,4 @@
|
|||||||
|
import { hexToBytes } from "@waku/utils/bytes";
|
||||||
import { ethers } from "ethers";
|
import { ethers } from "ethers";
|
||||||
|
|
||||||
import { RLN_REGISTRY_ABI, RLN_STORAGE_ABI } from "./constants.js";
|
import { RLN_REGISTRY_ABI, RLN_STORAGE_ABI } from "./constants.js";
|
||||||
@ -169,15 +170,11 @@ export class RLNContract {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idCommitment = ethers.utils.zeroPad(
|
const idCommitment = hexToBytes(_idCommitment?._hex);
|
||||||
ethers.utils.arrayify(_idCommitment),
|
|
||||||
32
|
|
||||||
);
|
|
||||||
rlnInstance.insertMember(idCommitment);
|
rlnInstance.insertMember(idCommitment);
|
||||||
this._members.set(index.toNumber(), {
|
this._members.set(index.toNumber(), {
|
||||||
index,
|
index,
|
||||||
idCommitment:
|
idCommitment: _idCommitment?._hex,
|
||||||
_idCommitment?._hex || ethers.utils.hexlify(idCommitment),
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user