From eb731a6e2fee31ab2c32db02390bda35f3bcb08f Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Tue, 28 Jul 2020 02:27:02 -0400 Subject: [PATCH] Add note commitment tree Position type --- zebra-chain/src/treestate/note_commitment_tree.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zebra-chain/src/treestate/note_commitment_tree.rs b/zebra-chain/src/treestate/note_commitment_tree.rs index 5a43d7946..b2698df07 100644 --- a/zebra-chain/src/treestate/note_commitment_tree.rs +++ b/zebra-chain/src/treestate/note_commitment_tree.rs @@ -18,6 +18,12 @@ use proptest_derive::Arbitrary; use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; +/// The index of a note’s commitment at the leafmost layer of its Note +/// Commitment Tree. +/// +/// https://zips.z.cash/protocol/protocol.pdf#merkletree +pub struct Position(pub(crate) u64); + // XXX: Depending on if we implement SproutNoteCommitmentTree or // similar, it may be worth it to define a NoteCommitmentTree trait.