[][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 Clone for Input[src]

impl Copy for Input[src]

impl Debug for Input[src]

impl DefaultHashable for Input[src]

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

impl Eq for Input[src]

impl Hash for Input[src]

impl Ord for Input[src]

impl PartialEq<Input> for Input[src]

impl PartialOrd<Input> for Input[src]

impl Readable for Input[src]

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

impl Serialize for Input[src]

impl Writeable for Input[src]

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

Auto Trait Implementations

impl RefUnwindSafe for Input

impl Send for Input

impl Sync for Input

impl Unpin for Input

impl UnwindSafe for Input

Blanket Implementations

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

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

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

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

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

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

impl<T> Erased for T

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> UnsafeAny for T where
    T: Any