Struct grin_wallet_libwallet::OutputData
source · pub struct OutputData {
pub root_key_id: Identifier,
pub key_id: Identifier,
pub n_child: u32,
pub commit: Option<String>,
pub mmr_index: Option<u64>,
pub value: u64,
pub status: OutputStatus,
pub height: u64,
pub lock_height: u64,
pub is_coinbase: bool,
pub tx_log_entry: Option<u32>,
}
Expand description
Information about an output that’s being tracked by the wallet. Must be enough to reconstruct the commitment associated with the ouput when the root private key is known.
Fields§
§root_key_id: Identifier
Root key_id that the key for this output is derived from
key_id: Identifier
Derived key for this output
n_child: u32
How many derivations down from the root key
commit: Option<String>
The actual commit, optionally stored
mmr_index: Option<u64>
PMMR Index, used on restore in case of duplicate wallets using the same key_id (2 wallets using same seed, for instance
value: u64
Value of the output, necessary to rebuild the commitment
status: OutputStatus
Current status of the output
height: u64
Height of the output
lock_height: u64
Height we are locked until
is_coinbase: bool
Is this a coinbase output? Is it subject to coinbase locktime?
tx_log_entry: Option<u32>
Optional corresponding internal entry in tx entry log
Implementations§
source§impl OutputData
impl OutputData
sourcepub fn num_confirmations(&self, current_height: u64) -> u64
pub fn num_confirmations(&self, current_height: u64) -> u64
How many confirmations has this output received? If height == 0 then we are either Unconfirmed or the output was cut-through so we do not actually know how many confirmations this output had (and never will).
sourcepub fn eligible_to_spend(
&self,
current_height: u64,
minimum_confirmations: u64
) -> bool
pub fn eligible_to_spend( &self, current_height: u64, minimum_confirmations: u64 ) -> bool
Check if output is eligible to spend based on state and height and confirmations
sourcepub fn mark_unspent(&mut self)
pub fn mark_unspent(&mut self)
Marks this output as unspent if it was previously unconfirmed
sourcepub fn mark_spent(&mut self)
pub fn mark_spent(&mut self)
Mark an output as spent
sourcepub fn mark_reverted(&mut self)
pub fn mark_reverted(&mut self)
Mark an output as reverted
Trait Implementations§
source§impl Clone for OutputData
impl Clone for OutputData
source§fn clone(&self) -> OutputData
fn clone(&self) -> OutputData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OutputData
impl Debug for OutputData
source§impl<'de> Deserialize<'de> for OutputData
impl<'de> Deserialize<'de> for OutputData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for OutputData
impl Ord for OutputData
source§fn cmp(&self, other: &OutputData) -> Ordering
fn cmp(&self, other: &OutputData) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for OutputData
impl PartialEq for OutputData
source§fn eq(&self, other: &OutputData) -> bool
fn eq(&self, other: &OutputData) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for OutputData
impl PartialOrd for OutputData
source§fn partial_cmp(&self, other: &OutputData) -> Option<Ordering>
fn partial_cmp(&self, other: &OutputData) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Readable for OutputData
impl Readable for OutputData
source§impl Serialize for OutputData
impl Serialize for OutputData
source§impl Writeable for OutputData
impl Writeable for OutputData
impl Eq for OutputData
impl StructuralPartialEq for OutputData
Auto Trait Implementations§
impl Freeze for OutputData
impl RefUnwindSafe for OutputData
impl Send for OutputData
impl Sync for OutputData
impl Unpin for OutputData
impl UnwindSafe for OutputData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<'a, T> DefaultFeatures<'a> for T
impl<'a, T> DefaultFeatures<'a> for T
source§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
Box
behind a trait object of this trait.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
source§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
Box
behind a trait object of this trait.