[][src]Struct grin_core::core::transaction::Input

pub struct Input {
    pub features: OutputFeatures,
    pub commit: Commitment,
}

A transaction input.

Primarily a reference to an output being spent by the transaction.

Fields

features: OutputFeatures

The features of the output being spent. We will check maturity for coinbase output.

commit: Commitment

The commit referencing the output being spent.

Methods

impl Input[src]

The input for a transaction, which spends a pre-existing unspent output. The input commitment is a reproduction of the commitment of the output being spent. Input must also provide the original output features and the hash of the block the output originated from.

pub fn new(features: OutputFeatures, commit: Commitment) -> Input[src]

Build a new input from the data required to identify and verify an output being spent.

pub fn commitment(&self) -> Commitment[src]

The input commitment which partially identifies the output being spent. In the presence of a fork we need additional info to uniquely identify the output. Specifically the block hash (to correctly calculate lock_height for coinbase outputs).

pub fn is_coinbase(&self) -> bool[src]

Is this a coinbase input?

pub fn is_plain(&self) -> bool[src]

Is this a plain input?

Trait Implementations

impl DefaultHashable for Input[src]

impl Writeable for Input[src]

Implementation of Writeable for a transaction Input, defines how to write an Input as binary.

impl Readable for Input[src]

Implementation of Readable for a transaction Input, defines how to read an Input from a binary stream.

impl PartialOrd<Input> for Input[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

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

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

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

impl PartialEq<Input> for Input[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for Input[src]

impl Ord for Input[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Restrict a value to a certain interval. Read more

impl Eq for Input[src]

impl Clone for Input[src]

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

Performs copy-assignment from source. Read more

impl Hash for Input[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Input[src]

impl Serialize for Input[src]

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

Auto Trait Implementations

impl Send for Input

impl Unpin for Input

impl Sync for Input

impl UnwindSafe for Input

impl RefUnwindSafe for Input

Blanket Implementations

impl<D> Hashed for D where
    D: DefaultHashable
[src]

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

fn short_id(&Self, &Hash, 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> PMMRIndexHashable for T where
    T: DefaultHashable
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T