Skip to content

Commit

Permalink
test: functional nullifier queue
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed May 10, 2024
1 parent 2be50bc commit 4bff2bf
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ node_modules
light-zk.js
/cli/.crates2.json
/cli/.crates.toml
test-programs/rnd-inf-test/**/*.txt
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl default::Default for NullifierQueueConfig {
}
}
}

pub fn process_initialize_state_merkle_tree_and_nullifier_queue(
ctx: Context<'_, '_, '_, '_, InitializeStateMerkleTreeAndNullifierQueue<'_>>,
index: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct InsertIntoNullifierQueues<'info> {
pub registered_program_pda: Option<Account<'info, RegisteredProgram>>, // nullifiers are sent in remaining accounts. @ErrorCode::InvalidVerifier
pub system_program: Program<'info, System>,
}

// TODO: add test that the first two elements of the queue cannot be inserted into the tree and removed from the queue
/// Inserts every element into the indexed array.
/// Throws an error if the element already exists.
/// Expects an indexed queue account as for every index as remaining account.
Expand Down Expand Up @@ -97,7 +97,6 @@ pub fn process_insert_into_nullifier_queues<'a, 'b, 'c: 'info, 'info>(
light_heap::bench_sbf_start!("acp_insert_nf_into_queue");
for element in queue_bundle.elements.iter() {
let element = BigUint::from_bytes_be(element.as_slice());
msg!("Inserting element {:?} into nullifier queue", element);
indexed_array
.insert(&element, sequence_number)
.map_err(ProgramError::from)?;
Expand Down
1 change: 1 addition & 0 deletions test-programs/account-compression-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ light-compressed-token = { path = "../../programs/compressed-token" , features
light-compressed-pda = { path = "../../programs/compressed-pda" , features = ["cpi"]}
account-compression = { path = "../../programs/account-compression" , features = ["cpi"] }
light-hasher = {path = "../../merkle-tree/hasher"}
light-hash-set = {path = "../../merkle-tree/hash-set"}
light-concurrent-merkle-tree = {path = "../../merkle-tree/concurrent"}
light-indexed-merkle-tree = {path = "../../merkle-tree/indexed"}
light-merkle-tree-reference = {path = "../../merkle-tree/reference"}
Expand Down
Loading

0 comments on commit 4bff2bf

Please sign in to comment.