mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-04-18 17:43:16 +00:00
fix: fixed size return for proof
This commit is contained in:
parent
3a89171cde
commit
57fca341b1
@ -177,7 +177,12 @@ contract WakuRlnV2 {
|
||||
/// @notice Returns the merkle proof elements of a given membership
|
||||
/// @param index The index of the member
|
||||
/// @return The merkle proof elements of the member
|
||||
function merkleProofElements(uint40 index) public view returns (uint256[] memory) {
|
||||
return LazyIMT.merkleProofElements(imtData, index, DEPTH);
|
||||
function merkleProofElements(uint40 index) public view returns (uint256[DEPTH] memory) {
|
||||
uint256[DEPTH] memory castedProof;
|
||||
uint256[] memory proof = LazyIMT.merkleProofElements(imtData, index, DEPTH);
|
||||
for (uint8 i = 0; i < DEPTH; i++) {
|
||||
castedProof[i] = proof[i];
|
||||
}
|
||||
return castedProof;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ contract WakuRlnV2Test is Test {
|
||||
assertEq(fetchedUserMessageLimit2, userMessageLimit);
|
||||
assertEq(index2, 0);
|
||||
assertEq(rateCommitment2, rateCommitment);
|
||||
uint256[] memory proof = w.merkleProofElements(0);
|
||||
uint256[20] memory proof = w.merkleProofElements(0);
|
||||
uint256[20] memory expectedProof = [
|
||||
0,
|
||||
14_744_269_619_966_411_208_579_211_824_598_458_697_587_494_354_926_760_081_771_325_075_741_142_829_156,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user