@@ -299,7 +299,7 @@ describe("CartesianMerkleTree", () => {
299299 const treapleRoot : string = await treaple . getUintRoot ( ) ;
300300
301301 for ( let i = 0 ; i < keysCount ; i ++ ) {
302- const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getUintNodesCount ( ) ) - 1 ) ) + 1 ;
302+ const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getUintNodesCount ( ) ) - 1 ) ) ;
303303 const proof = await treaple . getUintProof ( keys [ randIndex ] , 40 ) ;
304304
305305 await verifyCMTProof ( proof , treapleRoot , keys [ randIndex ] , true , true ) ;
@@ -624,7 +624,7 @@ describe("CartesianMerkleTree", () => {
624624 const treapleRoot : string = await treaple . getBytes32Root ( ) ;
625625
626626 for ( let i = 0 ; i < keysCount ; i ++ ) {
627- const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getBytes32NodesCount ( ) ) - 1 ) ) + 1 ;
627+ const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getBytes32NodesCount ( ) ) - 1 ) ) ;
628628 const proof = await treaple . getBytes32Proof ( keys [ randIndex ] , 40 ) ;
629629
630630 await verifyCMTProof ( proof , treapleRoot , keys [ randIndex ] , true , true ) ;
@@ -733,6 +733,7 @@ describe("CartesianMerkleTree", () => {
733733 break ;
734734 }
735735 }
736+
736737 const currentNode = await treaple . getAddressNode ( randIndex ) ;
737738 const currentNodeKey = `0x${ currentNode . key . slice ( 26 ) } ` ;
738739
@@ -757,7 +758,7 @@ describe("CartesianMerkleTree", () => {
757758 const treapleRoot : string = await treaple . getAddressRoot ( ) ;
758759
759760 for ( let i = 0 ; i < keysCount ; i ++ ) {
760- const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getAddressNodesCount ( ) ) - 1 ) ) + 1 ;
761+ const randIndex = Math . floor ( Math . random ( ) * ( Number ( await treaple . getAddressNodesCount ( ) ) - 1 ) ) ;
761762 const proof = await treaple . getAddressProof ( keys [ randIndex ] , 40 ) ;
762763
763764 await verifyCMTProof ( proof , treapleRoot , keys [ randIndex ] , true , true ) ;
0 commit comments