pub struct CachedSignedVtxoTree {
pub spec: SignedVtxoTreeSpec,
pub txs: Vec<Transaction>,
}Expand description
A fully signed VTXO tree, with all the transaction cached.
This is useful for cheap extraction of VTXO branches.
Fields§
§spec: SignedVtxoTreeSpec§txs: Vec<Transaction>All signed txs in this tree, starting with the leaves, towards the root.
Implementations§
Source§impl CachedSignedVtxoTree
impl CachedSignedVtxoTree
Sourcepub fn exit_branch(&self, leaf_idx: usize) -> Vec<&Transaction>
pub fn exit_branch(&self, leaf_idx: usize) -> Vec<&Transaction>
Construct the exit branch starting from the root ending in the leaf.
Panics if leaf_idx is out of range.
pub fn nb_leaves(&self) -> usize
pub fn nb_nodes(&self) -> usize
Sourcepub fn all_final_txs(&self) -> &[Transaction]
pub fn all_final_txs(&self) -> &[Transaction]
Get all final txs in this tree, starting with the leaves, towards the root.
The leaf transactions are unsigned and the node transactions are signed.
This is equivalent to unsigned_leaf_txs chained with signed_node_txs
Sourcepub fn unsigned_leaf_txs(&self) -> &[Transaction]
pub fn unsigned_leaf_txs(&self) -> &[Transaction]
Returns all leaf transactions
These transactions aren’t signed (yet)
Sourcepub fn internal_node_txs(&self) -> &[Transaction]
pub fn internal_node_txs(&self) -> &[Transaction]
Returns all internal node transactions
These transactions are fully signed
Sourcepub fn build_vtxo(&self, leaf_idx: usize) -> Vtxo<Full>
pub fn build_vtxo(&self, leaf_idx: usize) -> Vtxo<Full>
Construct the VTXO at the given leaf index.
Panics if leaf_idx is out of range.
Sourcepub fn internal_vtxos(
&self,
) -> impl Iterator<Item = ServerVtxo<Full>> + ExactSizeIterator + '_
pub fn internal_vtxos( &self, ) -> impl Iterator<Item = ServerVtxo<Full>> + ExactSizeIterator + '_
Construct all ServerVtxos
Sourcepub fn output_vtxos(
&self,
) -> impl Iterator<Item = Vtxo<Full>> + ExactSizeIterator + '_
pub fn output_vtxos( &self, ) -> impl Iterator<Item = Vtxo<Full>> + ExactSizeIterator + '_
Construct all individual vtxos from this round.