Struct grin_wallet_libwallet::TxLogEntry

source ·
pub struct TxLogEntry {
Show 18 fields 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<FeeFields>, pub ttl_cutoff_height: Option<u64>, pub stored_tx: Option<String>, pub kernel_excess: Option<Commitment>, pub kernel_lookup_min_height: Option<u64>, pub payment_proof: Option<StoredProofInfo>, pub reverted_after: Option<Duration>,
}
Expand description

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<FeeFields>

Fee

§ttl_cutoff_height: Option<u64>

Cutoff block height

§stored_tx: Option<String>

Location of the store transaction, (reference or resending)

§kernel_excess: Option<Commitment>

Associated kernel excess, for later lookup if necessary

§kernel_lookup_min_height: Option<u64>

Height reported when transaction was created, if lookup of kernel is necessary

§payment_proof: Option<StoredProofInfo>

Additional info needed to stored payment proof

§reverted_after: Option<Duration>

Track the time it took for a transaction to get reverted

Implementations§

source§

impl TxLogEntry

source

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

Return a new blank with TS initialised with next entry

source

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

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

source

pub fn update_confirmation_ts(&mut self)

Update confirmation TS with now

Trait Implementations§

source§

impl Clone for TxLogEntry

source§

fn clone(&self) -> TxLogEntry

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 TxLogEntry

source§

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

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

impl<'de> Deserialize<'de> for TxLogEntry

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 Readable for TxLogEntry

source§

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

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

impl Serialize for TxLogEntry

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 TxLogEntry

source§

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

Write the data held by this Writeable to the provided writer

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> 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<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,