[][src]Struct grin_wallet::libwallet::types::TxLogEntry

pub struct TxLogEntry {
    pub parent_key_id: Identifier,
    pub id: u32,
    pub tx_slate_id: Option<Uuid>,
    pub tx_type: TxLogEntryType,
    pub creation_ts: DateTime<Utc>,
    pub confirmation_ts: Option<DateTime<Utc>>,
    pub confirmed: bool,
    pub num_inputs: usize,
    pub num_outputs: usize,
    pub amount_credited: u64,
    pub amount_debited: u64,
    pub fee: Option<u64>,
    pub stored_tx: Option<String>,
}

Optional transaction information, recorded when an event happens to add or remove funds from a wallet. One Transaction log entry maps to one or many outputs

Fields

parent_key_id: Identifier

BIP32 account path used for creating this tx

id: u32

Local id for this transaction (distinct from a slate transaction id)

tx_slate_id: Option<Uuid>

Slate transaction this entry is associated with, if any

tx_type: TxLogEntryType

Transaction type (as above)

creation_ts: DateTime<Utc>

Time this tx entry was created #[serde(with = "tx_date_format")]

confirmation_ts: Option<DateTime<Utc>>

Time this tx was confirmed (by this wallet) #[serde(default, with = "opt_tx_date_format")]

confirmed: bool

Whether the inputs+outputs involved in this transaction have been confirmed (In all cases either all outputs involved in a tx should be confirmed, or none should be; otherwise there's a deeper problem)

num_inputs: usize

number of inputs involved in TX

num_outputs: usize

number of outputs involved in TX

amount_credited: u64

Amount credited via this transaction

amount_debited: u64

Amount debited via this transaction

fee: Option<u64>

Fee

stored_tx: Option<String>

Location of the store transaction, (reference or resending)

Methods

impl TxLogEntry
[src]

pub fn new(parent_key_id: Identifier, t: TxLogEntryType, id: u32) -> Self
[src]

Return a new blank with TS initialised with next entry

pub fn sum_confirmed(txs: &Vec<TxLogEntry>) -> (u64, u64)
[src]

Given a vec of TX log entries, return credited + debited sums

pub fn update_confirmation_ts(&mut self)
[src]

Update confirmation TS with now

Trait Implementations

impl Clone for TxLogEntry
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for TxLogEntry
[src]

impl Serialize for TxLogEntry
[src]

impl<'de> Deserialize<'de> for TxLogEntry
[src]

impl Readable for TxLogEntry
[src]

impl Writeable for TxLogEntry
[src]

Auto Trait Implementations

impl Send for TxLogEntry

impl Sync for TxLogEntry

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

impl<T> Erased for T

impl<W> Hashed for W where
    W: Writeable
[src]

impl<T> PMMRIndexHashable for T where
    T: Writeable
[src]

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

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

impl<T> UnsafeAny for T where
    T: Any

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

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

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

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

impl<T> Same for T

type Output = T

Should always be Self