Commit graph

927 commits

Author SHA1 Message Date
b15f41cd99 SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-24 13:22:57 +02:00
f4d8603b32 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:22:57 +02:00
950741b255 squash 'move try_from doc to function level' into 'add SparseMerklePath' 2025-04-24 13:22:33 +02:00
Grzegorz Świrski
8f0e5ef9da use Cow instead of the additional IntoIter struct 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
1ecb51b493 loop over depths in tests 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
14172558cc clarify empty_nodes_mask documentation 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
386f379fac clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
a2748bbf29 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
01ba227880 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
226f5b5340 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
8006beaaab move comment 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
9855f035e0 return a deserialization error if too many empty nodes detected 2025-04-24 13:21:51 +02:00
4c990ba631 sort crate:: imports after super:: imports 2025-04-24 13:21:51 +02:00
6463802d7a smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:21:51 +02:00
abbe8d1638 SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-24 13:21:51 +02:00
c5c9cb7345 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:21:51 +02:00
36ecb991d5 squash 'clearer assertions in sparse_path tests' into 'add SparseMerklePath' 2025-04-24 13:20:59 +02:00
Grzegorz Świrski
6c9b5f1eaa use Cow instead of the additional IntoIter struct 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
a96143da4f loop over depths in tests 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
0dc3e35501 clarify empty_nodes_mask documentation 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
10a64e7e08 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
87dc60e054 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
34457f8b9c make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
e63b3a8949 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
6978cea693 move comment 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
987b50a172 return a deserialization error if too many empty nodes detected 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
3a89096daf move try_from doc to function level for better ide support 2025-04-24 13:20:08 +02:00
de625fc4ce sort crate:: imports after super:: imports 2025-04-24 13:20:08 +02:00
c210f1d934 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:20:08 +02:00
03f30b9b5a SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-24 13:20:08 +02:00
17dee2edfb smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:20:08 +02:00
9e7e8a60b4 split out 'sort crate:: imports after super:: imports' 2025-04-24 13:20:05 +02:00
Grzegorz Świrski
750ce32a71 use Cow instead of the additional IntoIter struct 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
4356d11e59 loop over depths in tests 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
0cc404c66f clarify empty_nodes_mask documentation 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
8676326550 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
5d8e3f0cf8 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
3362aeaddb make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
6eb93aa334 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
92085a75e0 move comment 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
7daabb1964 return a deserialization error if too many empty nodes detected 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
33e2d226a1 move try_from doc to function level for better ide support 2025-04-24 13:19:48 +02:00
a2a315d46d sort crate:: imports after super:: imports 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
2df454c855 clearer assertions in sparse_path tests 2025-04-24 13:19:48 +02:00
a06a7b1b7e squash 'swap test_borrowing_iterator and test_owning_iterator names' into 'add SparseMerklePath' 2025-04-24 13:18:08 +02:00
e5950497f5 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
98e0d50b71 use Cow instead of the additional IntoIter struct 2025-04-24 13:17:37 +02:00
6b07ac510d SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-24 13:17:37 +02:00
Grzegorz Świrski
a5e7f14943 loop over depths in tests 2025-04-24 13:17:37 +02:00
45eca087c3 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:17:37 +02:00