Struct ckb_jsonrpc_types::TransactionTemplate
source · [−]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
sourceimpl Clone for TransactionTemplate
impl Clone for TransactionTemplate
sourcefn clone(&self) -> TransactionTemplate
fn clone(&self) -> TransactionTemplate
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TransactionTemplate
impl Debug for TransactionTemplate
sourceimpl Default for TransactionTemplate
impl Default for TransactionTemplate
sourcefn default() -> TransactionTemplate
fn default() -> TransactionTemplate
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for TransactionTemplate
impl<'de> Deserialize<'de> for TransactionTemplate
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<TransactionTemplate> for Transaction
impl From<TransactionTemplate> for Transaction
sourcefn from(template: TransactionTemplate) -> Self
fn from(template: TransactionTemplate) -> Self
Converts to this type from the input type.
sourceimpl Hash for TransactionTemplate
impl Hash for TransactionTemplate
sourceimpl PartialEq<TransactionTemplate> for TransactionTemplate
impl PartialEq<TransactionTemplate> for TransactionTemplate
sourcefn eq(&self, other: &TransactionTemplate) -> bool
fn eq(&self, other: &TransactionTemplate) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TransactionTemplate) -> bool
fn ne(&self, other: &TransactionTemplate) -> bool
This method tests for !=
.
sourceimpl Serialize for TransactionTemplate
impl Serialize for TransactionTemplate
impl Eq for TransactionTemplate
impl StructuralEq for TransactionTemplate
impl StructuralPartialEq for TransactionTemplate
Auto Trait Implementations
impl RefUnwindSafe for TransactionTemplate
impl Send for TransactionTemplate
impl Sync for TransactionTemplate
impl Unpin for TransactionTemplate
impl UnwindSafe for TransactionTemplate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more