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
impl Clone for TransactionTemplate
Source§fn clone(&self) -> TransactionTemplate
fn clone(&self) -> TransactionTemplate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TransactionTemplate
impl Debug for TransactionTemplate
Source§impl Default for TransactionTemplate
impl Default for TransactionTemplate
Source§fn default() -> TransactionTemplate
fn default() -> TransactionTemplate
Source§impl<'de> Deserialize<'de> for TransactionTemplate
impl<'de> Deserialize<'de> for TransactionTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<TransactionTemplate> for Transaction
impl From<TransactionTemplate> for Transaction
Source§fn from(template: TransactionTemplate) -> Self
fn from(template: TransactionTemplate) -> Self
Source§impl Hash for TransactionTemplate
impl Hash for TransactionTemplate
Source§impl JsonSchema for TransactionTemplate
impl JsonSchema for TransactionTemplate
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more