@@ -50,15 +50,12 @@ describe("RLN Proof Integration Tests", function () {
5050 // Use the known credential hash and password from the test data
5151 const credentialHash = TEST_KEYSTORE_DATA . credentialHash ;
5252 const password = TEST_KEYSTORE_DATA . password ;
53- console . log ( `Using credential hash: ${ credentialHash } ` ) ;
5453 const credential = await keystore . readCredential ( credentialHash , password ) ;
5554 if ( ! credential ) {
5655 throw new Error ( "Failed to unlock credential with provided password" ) ;
5756 }
5857
59- // Extract the ID commitment from the credential
6058 const idCommitment = credential . identity . IDCommitmentBigInt ;
61- console . log ( `ID Commitment from keystore: ${ idCommitment . toString ( ) } ` ) ;
6259
6360 const publicClient = createPublicClient ( {
6461 chain : lineaSepolia ,
@@ -76,36 +73,25 @@ describe("RLN Proof Integration Tests", function () {
7673 walletClient : dummyWalletClient
7774 } ) ;
7875
79- // First, get membership info to find the index
8076 const membershipInfo = await contract . getMembershipInfo ( idCommitment ) ;
8177
8278 if ( ! membershipInfo ) {
83- console . log (
79+ throw new Error (
8480 `ID commitment ${ idCommitment . toString ( ) } not found in membership set`
8581 ) ;
86- this . skip ( ) ;
87- return ;
8882 }
8983
90- console . log ( `Found membership at index: ${ membershipInfo . index } ` ) ;
91- console . log ( `Membership state: ${ membershipInfo . state } ` ) ;
92-
93- // Get the merkle proof for this member's index
9484 const merkleProof = await contract . getMerkleProof ( membershipInfo . index ) ;
9585
9686 expect ( merkleProof ) . to . be . an ( "array" ) ;
9787 expect ( merkleProof ) . to . have . lengthOf ( MERKLE_TREE_DEPTH ) ; // RLN uses fixed depth merkle tree
9888
99- console . log ( `Merkle proof for ID commitment ${ idCommitment . toString ( ) } :` ) ;
100- console . log ( `Index: ${ membershipInfo . index } ` ) ;
101- console . log ( `Proof elements (${ merkleProof . length } ):` ) ;
10289 merkleProof . forEach ( ( element , i ) => {
10390 console . log (
10491 ` [${ i } ]: ${ element . toString ( ) } (0x${ element . toString ( 16 ) } )`
10592 ) ;
10693 } ) ;
10794
108- // Verify all proof elements are valid bigints
10995 merkleProof . forEach ( ( element , i ) => {
11096 expect ( element ) . to . be . a (
11197 "bigint" ,
@@ -115,7 +101,7 @@ describe("RLN Proof Integration Tests", function () {
115101 } ) ;
116102 } ) ;
117103
118- it . only ( "should generate a valid RLN proof" , async function ( ) {
104+ it ( "should generate a valid RLN proof" , async function ( ) {
119105 const publicClient = createPublicClient ( {
120106 chain : lineaSepolia ,
121107 transport : http ( rpcUrl )
@@ -131,7 +117,6 @@ describe("RLN Proof Integration Tests", function () {
131117 publicClient,
132118 walletClient : dummyWalletClient
133119 } ) ;
134- // get credential from keystore
135120 const keystore = Keystore . fromString ( TEST_KEYSTORE_DATA . keystoreJson ) ;
136121 if ( ! keystore ) {
137122 throw new Error ( "Failed to load test keystore" ) ;
@@ -153,7 +138,6 @@ describe("RLN Proof Integration Tests", function () {
153138 const merkleRoot = await contract . getMerkleRoot ( ) ;
154139 const rateCommitment = calculateRateCommitment ( idCommitment , rateLimit ) ;
155140
156- // Get the array of indexes that correspond to each proof element
157141 const proofElementIndexes = extractPathDirectionsFromProof (
158142 merkleProof ,
159143 rateCommitment ,
@@ -163,10 +147,8 @@ describe("RLN Proof Integration Tests", function () {
163147 throw new Error ( "Failed to extract proof element indexes" ) ;
164148 }
165149
166- // Verify the array has the correct length
167150 expect ( proofElementIndexes ) . to . have . lengthOf ( MERKLE_TREE_DEPTH ) ;
168151
169- // Verify that we can reconstruct the root using these indexes
170152 const reconstructedRoot = reconstructMerkleRoot (
171153 merkleProof as bigint [ ] ,
172154 BigInt ( membershipInfo . index ) ,
0 commit comments