Proof structs should have some properties merged into tuples
slawlor opened this issue · comments
Sean Lawlor commented
In MembershipProof
, the sibling hashes and sibling labels are a 1-1 mapping and therefore should be a Vec<(NodeLabel, Digest)>
rather than 2 separate properties.
Same thing in a NonMembershipProof
with longest_prefix_children*
, they can be merged into a single property of a tuple.
This syntax is warranted as it's already used in AppendOnlyProof
with the inserted and unchanged nodes.
David Julian commented
I'm working on sorting this and have taken it a small step further, replacing (NodeLabel, Digest)
tuples with a named struct, Node
. This is allowing named access instead of dancing around ordinal access of the tuple, making this a little easier to read.