Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
content_addressed_cache.test.cpp File Reference

Go to the source code of this file.

Classes

class  ContentAddressedCacheTest
 

Typedefs

using LeafValueType = PublicDataLeafValue
 
using IndexedLeafType = IndexedLeaf< PublicDataLeafValue >
 
using CacheType = ContentAddressedCache< PublicDataLeafValue >
 

Functions

uint64_t get_index (uint64_t max_index=0)
 
void add_to_cache (CacheType &cache, index_t leaf_offset, uint64_t num_leaves, uint64_t num_nodes, uint64_t max_index=0)
 
CacheType create_cache (uint32_t depth)
 
 TEST_F (ContentAddressedCacheTest, can_create_cache)
 
 TEST_F (ContentAddressedCacheTest, can_checkpoint_cache)
 
 TEST_F (ContentAddressedCacheTest, can_not_revert_cache_without_checkpoint)
 
 TEST_F (ContentAddressedCacheTest, can_not_commit_cache_without_checkpoint)
 
std::vector< frsetup_nodes_test (uint32_t level, uint64_t index, CacheType &cache)
 
 TEST_F (ContentAddressedCacheTest, commit_then_revert_nodes)
 
 TEST_F (ContentAddressedCacheTest, commit_then_commit_nodes)
 
 TEST_F (ContentAddressedCacheTest, revert_then_commit_nodes)
 
 TEST_F (ContentAddressedCacheTest, revert_then_revert_nodes)
 
std::optional< IndexedLeafTypeget_leaf_by_index (CacheType &cache, index_t index)
 
std::vector< IndexedLeafTypesetup_leaves_tests (uint32_t index, CacheType &cache)
 
 TEST_F (ContentAddressedCacheTest, commit_then_revert_leaves)
 
 TEST_F (ContentAddressedCacheTest, commit_then_commit_leaves)
 
 TEST_F (ContentAddressedCacheTest, revert_then_commit_leaves)
 
 TEST_F (ContentAddressedCacheTest, revert_then_revert_leaves)
 
 TEST_F (ContentAddressedCacheTest, can_revert_cache)
 
 TEST_F (ContentAddressedCacheTest, can_commit_cache)
 
 TEST_F (ContentAddressedCacheTest, can_commit_all)
 
 TEST_F (ContentAddressedCacheTest, can_revert_all)
 
 TEST_F (ContentAddressedCacheTest, can_revert_through_multiple_levels)
 
 TEST_F (ContentAddressedCacheTest, can_commit_through_multiple_levels)
 
void test_reverts_remove_all_deeper_commits (uint64_t max_index, uint32_t depth, uint64_t num_levels)
 
 TEST_F (ContentAddressedCacheTest, reverts_remove_all_deeper_commits)
 
void reverts_remove_all_deeper_commits_2 (uint64_t max_index, uint32_t depth, uint64_t num_levels)
 
 TEST_F (ContentAddressedCacheTest, reverts_remove_all_deeper_commits_2)
 
 TEST_F (ContentAddressedCacheTest, checkpoint_returns_depth)
 
 TEST_F (ContentAddressedCacheTest, depth_reports_journal_count)
 
 TEST_F (ContentAddressedCacheTest, commit_to_depth_partial)
 
 TEST_F (ContentAddressedCacheTest, revert_to_depth_partial)
 
 TEST_F (ContentAddressedCacheTest, commit_to_depth_0_is_commit_all)
 
 TEST_F (ContentAddressedCacheTest, revert_to_depth_0_is_revert_all)
 
 TEST_F (ContentAddressedCacheTest, commit_to_depth_at_current_is_single_commit)
 
 TEST_F (ContentAddressedCacheTest, revert_to_depth_at_current_is_single_revert)
 
 TEST_F (ContentAddressedCacheTest, revert_to_depth_preserves_lower_data)
 
 TEST_F (ContentAddressedCacheTest, commit_to_depth_invalid_depth_throws)
 

Typedef Documentation

◆ CacheType

◆ IndexedLeafType

◆ LeafValueType

Function Documentation

◆ add_to_cache()

void add_to_cache ( CacheType cache,
index_t  leaf_offset,
uint64_t  num_leaves,
uint64_t  num_nodes,
uint64_t  max_index = 0 
)

Definition at line 29 of file content_addressed_cache.test.cpp.

◆ create_cache()

CacheType create_cache ( uint32_t  depth)

Definition at line 62 of file content_addressed_cache.test.cpp.

◆ get_index()

uint64_t get_index ( uint64_t  max_index = 0)

Definition at line 23 of file content_addressed_cache.test.cpp.

◆ get_leaf_by_index()

std::optional< IndexedLeafType > get_leaf_by_index ( CacheType cache,
index_t  index 
)

Definition at line 210 of file content_addressed_cache.test.cpp.

◆ reverts_remove_all_deeper_commits_2()

void reverts_remove_all_deeper_commits_2 ( uint64_t  max_index,
uint32_t  depth,
uint64_t  num_levels 
)

Definition at line 548 of file content_addressed_cache.test.cpp.

◆ setup_leaves_tests()

std::vector< IndexedLeafType > setup_leaves_tests ( uint32_t  index,
CacheType cache 
)

Definition at line 221 of file content_addressed_cache.test.cpp.

◆ setup_nodes_test()

std::vector< fr > setup_nodes_test ( uint32_t  level,
uint64_t  index,
CacheType cache 
)

Definition at line 99 of file content_addressed_cache.test.cpp.

◆ TEST_F() [1/30]

TEST_F ( ContentAddressedCacheTest  ,
can_checkpoint_cache   
)

Definition at line 78 of file content_addressed_cache.test.cpp.

◆ TEST_F() [2/30]

TEST_F ( ContentAddressedCacheTest  ,
can_commit_all   
)

Definition at line 421 of file content_addressed_cache.test.cpp.

◆ TEST_F() [3/30]

TEST_F ( ContentAddressedCacheTest  ,
can_commit_cache   
)

Definition at line 405 of file content_addressed_cache.test.cpp.

◆ TEST_F() [4/30]

TEST_F ( ContentAddressedCacheTest  ,
can_commit_through_multiple_levels   
)

Definition at line 482 of file content_addressed_cache.test.cpp.

◆ TEST_F() [5/30]

TEST_F ( ContentAddressedCacheTest  ,
can_create_cache   
)

Definition at line 72 of file content_addressed_cache.test.cpp.

◆ TEST_F() [6/30]

TEST_F ( ContentAddressedCacheTest  ,
can_not_commit_cache_without_checkpoint   
)

Definition at line 91 of file content_addressed_cache.test.cpp.

◆ TEST_F() [7/30]

TEST_F ( ContentAddressedCacheTest  ,
can_not_revert_cache_without_checkpoint   
)

Definition at line 85 of file content_addressed_cache.test.cpp.

◆ TEST_F() [8/30]

TEST_F ( ContentAddressedCacheTest  ,
can_revert_all   
)

Definition at line 442 of file content_addressed_cache.test.cpp.

◆ TEST_F() [9/30]

TEST_F ( ContentAddressedCacheTest  ,
can_revert_cache   
)

Definition at line 395 of file content_addressed_cache.test.cpp.

◆ TEST_F() [10/30]

TEST_F ( ContentAddressedCacheTest  ,
can_revert_through_multiple_levels   
)

Definition at line 462 of file content_addressed_cache.test.cpp.

◆ TEST_F() [11/30]

TEST_F ( ContentAddressedCacheTest  ,
checkpoint_returns_depth   
)

Definition at line 594 of file content_addressed_cache.test.cpp.

◆ TEST_F() [12/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_then_commit_leaves   
)

Definition at line 286 of file content_addressed_cache.test.cpp.

◆ TEST_F() [13/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_then_commit_nodes   
)

Definition at line 142 of file content_addressed_cache.test.cpp.

◆ TEST_F() [14/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_then_revert_leaves   
)

Definition at line 253 of file content_addressed_cache.test.cpp.

◆ TEST_F() [15/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_then_revert_nodes   
)

Definition at line 120 of file content_addressed_cache.test.cpp.

◆ TEST_F() [16/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_to_depth_0_is_commit_all   
)

Definition at line 677 of file content_addressed_cache.test.cpp.

◆ TEST_F() [17/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_to_depth_at_current_is_single_commit   
)

Definition at line 719 of file content_addressed_cache.test.cpp.

◆ TEST_F() [18/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_to_depth_invalid_depth_throws   
)

Definition at line 787 of file content_addressed_cache.test.cpp.

◆ TEST_F() [19/30]

TEST_F ( ContentAddressedCacheTest  ,
commit_to_depth_partial   
)

Definition at line 618 of file content_addressed_cache.test.cpp.

◆ TEST_F() [20/30]

TEST_F ( ContentAddressedCacheTest  ,
depth_reports_journal_count   
)

Definition at line 604 of file content_addressed_cache.test.cpp.

◆ TEST_F() [21/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_then_commit_leaves   
)

Definition at line 323 of file content_addressed_cache.test.cpp.

◆ TEST_F() [22/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_then_commit_nodes   
)

Definition at line 164 of file content_addressed_cache.test.cpp.

◆ TEST_F() [23/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_then_revert_leaves   
)

Definition at line 361 of file content_addressed_cache.test.cpp.

◆ TEST_F() [24/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_then_revert_nodes   
)

Definition at line 187 of file content_addressed_cache.test.cpp.

◆ TEST_F() [25/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_to_depth_0_is_revert_all   
)

Definition at line 698 of file content_addressed_cache.test.cpp.

◆ TEST_F() [26/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_to_depth_at_current_is_single_revert   
)

Definition at line 739 of file content_addressed_cache.test.cpp.

◆ TEST_F() [27/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_to_depth_partial   
)

Definition at line 651 of file content_addressed_cache.test.cpp.

◆ TEST_F() [28/30]

TEST_F ( ContentAddressedCacheTest  ,
revert_to_depth_preserves_lower_data   
)

Definition at line 760 of file content_addressed_cache.test.cpp.

◆ TEST_F() [29/30]

TEST_F ( ContentAddressedCacheTest  ,
reverts_remove_all_deeper_commits   
)

Definition at line 534 of file content_addressed_cache.test.cpp.

◆ TEST_F() [30/30]

◆ test_reverts_remove_all_deeper_commits()

void test_reverts_remove_all_deeper_commits ( uint64_t  max_index,
uint32_t  depth,
uint64_t  num_levels 
)

Definition at line 502 of file content_addressed_cache.test.cpp.