pub struct TransactionTemplate {
    pub hash: H256,
    pub required: bool,
    pub cycles: Option<Cycle>,
    pub depends: Option<Vec<Uint64>>,
    pub data: Transaction,
}
Expand description

Transaction template which is ready to be committed in the new block.

Fields§

§hash: H256

Transaction hash.

§required: bool

Whether miner must include this transaction in the new block.

§cycles: Option<Cycle>

The hint of how many cycles this transaction consumes.

Miners can utilize this field to ensure that the total cycles do not exceed the limit while selecting transactions.

§depends: Option<Vec<Uint64>>

Transaction dependencies.

This is a hint to help miners selecting transactions.

This transaction can only be committed if its dependencies are also committed in the new block.

This field is a list of indices into the array transactions in the block template.

For example, depends = [1, 2] means this transaction depends on block_template.transactions[1] and block_template.transactions[2].

§data: Transaction

The transaction.

Miners must keep it unchanged when including it in the new block.

Trait Implementations§

source§

impl Clone for TransactionTemplate

source§

fn clone(&self) -> TransactionTemplate

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 TransactionTemplate

source§

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

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

impl Default for TransactionTemplate

source§

fn default() -> TransactionTemplate

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for TransactionTemplate

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 From<TransactionTemplate> for Transaction

source§

fn from(template: TransactionTemplate) -> Self

Converts to this type from the input type.
source§

impl Hash for TransactionTemplate

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

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

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TransactionTemplate

source§

fn eq(&self, other: &TransactionTemplate) -> 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 Serialize for TransactionTemplate

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 Eq for TransactionTemplate

source§

impl StructuralEq for TransactionTemplate

source§

impl StructuralPartialEq for TransactionTemplate

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

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

§

fn vzip(self) -> V

source§

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