Kris Nuttycombe
8bb1962153
Update incrementalmerkletree version and add SER_V2 serialization constant.
2022-05-04 09:25:07 -06:00
Kris Nuttycombe
4d5b3831d1
Add conversion from incrementalmerkletree::bridgetree::Frontier -> CommitmentTree
...
Also, add roundtrip property tests to ensure the correctness of the
conversion.
2022-04-08 13:08:48 -06:00
Kris Nuttycombe
71657b4f18
Generalize vector and array writes & reads.
...
In a number of places, we transform other kinds of collections with
known length information into vectors simply to be able to use them with
`Vector::write` or `Vector::read`. We can avoid these extra allocations
by writing from iterators directly, and similarly by reading directly
into our desired collection types.
2022-03-11 16:48:28 -07:00
Kris Nuttycombe
d602c01ef6
Standardize how we write and read usize values for incrementalmerkletree.
...
Also, make consistent use of helper functions for reading
and writing `Position` values.
2022-03-11 16:48:28 -07:00
Kris Nuttycombe
b97d777361
Update the versions of incrementalmerkletree & orchard.
...
This removes unreleased incrementalmerkletree::BridgeTree serialization
that was zcashd-specific.
2022-02-24 13:54:31 -07:00
Kris Nuttycombe
a304c3953b
Fix Clippy beta linting complaints.
2022-02-02 16:02:45 -07:00
Jack Grigg
07a95d70c9
incrementalmerkletree 0.2
2021-12-17 23:46:00 +00:00
Jack Grigg
4770675542
Bump Orchard patch to include Merkle path cleanups
2021-09-16 22:55:22 +01:00
Kris Nuttycombe
ef98c7e48c
Add zcash_encoding crate.
...
The CompactSize type, and the standardized encodings for the Vector,
Array and Option types are moved to the newly created crate.
2021-08-31 13:19:24 -06:00
Kris Nuttycombe
77bb78d960
Apply suggestions from code review.
2021-08-17 07:31:15 -06:00
Kris Nuttycombe
7b953283ce
Add blanket implementation of Hashable for incrementalmerkletree::Hashable + HashSer
2021-08-16 13:48:37 -06:00
Kris Nuttycombe
837ad19262
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-08-16 10:20:14 -06:00
Kris Nuttycombe
5ba7bbc53b
Serialize `Option` values by value, not by reference.
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-08-16 10:06:38 -06:00
Kris Nuttycombe
2945905d52
Implement manual serialization for incremental Merkle tree components.
...
This also adds parsing of the legacy CommitmentTree format,
to permit easy migration of persisted data.
2021-08-05 09:32:44 -06:00