Skip to content

Commit ac0a8d3

Browse files
committed
fix(zk-id): use V1 trees (immediately provable merkle proofs) instead of V2 batched trees
1 parent 4f05564 commit ac0a8d3

1 file changed

Lines changed: 5 additions & 20 deletions

File tree

‎zk/zk-id/tests/test.rs‎

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use light_client::{
1111
};
1212
use light_hasher::{hash_to_field_size::hash_to_bn254_field_size_be, Hasher, Poseidon, Sha256};
1313
use light_sdk::{
14-
address::v2::derive_address,
14+
address::v1::derive_address,
1515
instruction::{PackedAccounts, SystemAccountMetaConfig},
1616
};
1717
use num_bigint::BigUint;
@@ -160,7 +160,7 @@ async fn test_create_issuer_and_add_credential() {
160160
.await
161161
.unwrap();
162162

163-
let address_tree_info = rpc.get_address_tree_v2();
163+
let address_tree_info = rpc.get_address_tree_v1();
164164

165165
let (issuer_address, _) = derive_address(
166166
&[ISSUER, payer.pubkey().as_ref()],
@@ -235,21 +235,6 @@ async fn test_create_issuer_and_add_credential() {
235235
.value
236236
.expect("Credential account not found");
237237
println!("credential_account {:?}", credential_account);
238-
239-
// The credential account is indexed before its merkle-tree leaf/proof is,
240-
// so wait until the proof is available before verifying (avoids
241-
// "Leaf nodes not found for hashes").
242-
for _ in 0..30 {
243-
if rpc
244-
.get_multiple_compressed_account_proofs(vec![credential_account.hash], None)
245-
.await
246-
.is_ok()
247-
{
248-
break;
249-
}
250-
tokio::time::sleep(Duration::from_millis(500)).await;
251-
}
252-
253238
verify_credential(
254239
&mut rpc,
255240
&payer,
@@ -300,7 +285,7 @@ where
300285
.pack_tree_infos(&mut remaining_accounts)
301286
.address_trees;
302287
let output_state_tree_index = rpc
303-
.get_random_state_tree_info()?
288+
.get_random_state_tree_info_v1()?
304289
.pack_output_tree_index(&mut remaining_accounts)?;
305290

306291
let (remaining_accounts_metas, system_accounts_offset, _) =
@@ -367,7 +352,7 @@ where
367352
};
368353

369354
let output_state_tree_index = rpc
370-
.get_random_state_tree_info()?
355+
.get_random_state_tree_info_v1()?
371356
.pack_output_tree_index(&mut remaining_accounts)?;
372357

373358
// Parse the issuer account data to get num_credentials_issued
@@ -489,7 +474,7 @@ where
489474
.address_trees;
490475

491476
let output_state_tree_index = rpc
492-
.get_random_state_tree_info()?
477+
.get_random_state_tree_info_v1()?
493478
.pack_output_tree_index(&mut remaining_accounts)?;
494479

495480
let (remaining_accounts_metas, system_accounts_offset, _) =

0 commit comments

Comments
 (0)