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

source

pub fn lock(&mut self)

Lock a given output to avoid conflicting use

source

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).

source

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

source

pub fn mark_unspent(&mut self)

Marks this output as unspent if it was previously unconfirmed

source

pub fn mark_spent(&mut self)

Mark an output as spent

source

pub fn mark_reverted(&mut self)

Mark an output as reverted

Trait Implementations§

source§

impl Clone for OutputData

source§

fn clone(&self) -> OutputData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OutputData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for OutputData

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Ord for OutputData

source§

fn cmp(&self, other: &OutputData) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for OutputData

source§

fn eq(&self, other: &OutputData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for OutputData

source§

fn partial_cmp(&self, other: &OutputData) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Readable for OutputData

source§

fn read<R: Reader>(reader: &mut R) -> Result<OutputData, Error>

Reads the data necessary to this Readable from the provided reader
source§

impl Serialize for OutputData

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Writeable for OutputData

source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Write the data held by this Writeable to the provided writer
source§

impl Eq for OutputData

source§

impl StructuralPartialEq for OutputData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AnyEq for T
where T: Any + PartialEq,

source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneAny for T
where T: Any + Clone,

source§

fn clone_any(&self) -> Box<dyn CloneAny>

source§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send>
where T: Send,

source§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync>
where T: Sync,

source§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Send + Sync>
where T: Send + Sync,

source§

impl<'a, T> DefaultFeatures<'a> for T
where T: 'a + Send + Sync + Clone,

source§

fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
source§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<'a, T> NonSyncFeatures<'a> for T
where T: 'a + Clone,

source§

fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
source§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<T> SafeBorrow<T> for T
where T: ?Sized,

source§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DebugAny for T
where T: Any + Debug,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> UnsafeAny for T
where T: Any,