Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "indexed_tree.hpp"
#include "../array_store.hpp"
#include "../hash.hpp"
#include "../nullifier_tree/nullifier_memory_tree.hpp"
#include "barretenberg/common/streams.hpp"
#include "barretenberg/common/test.hpp"
#include "barretenberg/numeric/random/engine.hpp"
#include "leaves_cache.hpp"
Go to the source code of this file.
Typedefs | |
using | HashPolicy = Poseidon2HashPolicy |
Functions | |
TEST (stdlib_indexed_tree, can_create) | |
TEST (stdlib_indexed_tree, test_size) | |
TEST (stdlib_indexed_tree, test_get_hash_path) | |
TEST (stdlib_indexed_tree, test_batch_insert) | |
fr | hash_leaf (const indexed_leaf &leaf) |
bool | check_hash_path (const fr &root, const fr_hash_path &path, const indexed_leaf &leaf_value, const size_t idx) |
TEST (stdlib_indexed_tree, test_indexed_memory) | |
TEST (stdlib_indexed_tree, test_indexed_tree) | |
Variables | |
const size_t | NUM_VALUES = 1024 |
using HashPolicy = Poseidon2HashPolicy |
Definition at line 13 of file indexed_tree.test.cpp.
bool check_hash_path | ( | const fr & | root, |
const fr_hash_path & | path, | ||
const indexed_leaf & | leaf_value, | ||
const size_t | idx | ||
) |
Definition at line 139 of file indexed_tree.test.cpp.
fr hash_leaf | ( | const indexed_leaf & | leaf | ) |
Definition at line 134 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
can_create | |||
) |
Definition at line 29 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
test_batch_insert | |||
) |
Definition at line 84 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
test_get_hash_path | |||
) |
Definition at line 60 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
test_indexed_memory | |||
) |
Intial state:
val 0 0 0 0 0 0 0 0 nextIdx 0 0 0 0 0 0 0 0 nextVal 0 0 0 0 0 0 0 0
Add new value 30:
val 0 30 0 0 0 0 0 0 nextIdx 1 0 0 0 0 0 0 0 nextVal 30 0 0 0 0 0 0 0
Add new value 10:
val 0 30 10 0 0 0 0 0 nextIdx 2 0 1 0 0 0 0 0 nextVal 10 0 30 0 0 0 0 0
Add new value 20:
val 0 30 10 20 0 0 0 0 nextIdx 2 0 3 1 0 0 0 0 nextVal 10 0 20 30 0 0 0 0
Add new value 50:
val 0 30 10 20 50 0 0 0 nextIdx 2 4 3 1 0 0 0 0 nextVal 10 50 20 30 0 0 0 0
Definition at line 153 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
test_indexed_tree | |||
) |
Definition at line 291 of file indexed_tree.test.cpp.
TEST | ( | stdlib_indexed_tree | , |
test_size | |||
) |
Definition at line 39 of file indexed_tree.test.cpp.
const size_t NUM_VALUES = 1024 |
Definition at line 20 of file indexed_tree.test.cpp.