Struct thor_devkit::transactions::Clause
source · pub struct Clause {
pub to: Option<Address>,
pub value: U256,
pub data: Bytes,
}Expand description
Represents a single transaction clause (recipient, value and data).
Fields§
§to: Option<Address>Recipient
value: U256Amount of funds to spend.
data: BytesContract code or other data.
Implementations§
source§impl Clause
impl Clause
sourcepub const REGULAR_CLAUSE_GAS: u64 = 16_000u64
pub const REGULAR_CLAUSE_GAS: u64 = 16_000u64
Gas spent for one regular clause execution.
sourcepub const CONTRACT_CREATION_CLAUSE_GAS: u64 = 48_000u64
pub const CONTRACT_CREATION_CLAUSE_GAS: u64 = 48_000u64
Gas spent for one contract creation (without to) clause execution.
sourcepub const ZERO_DATA_BYTE_GAS_COST: u64 = 4u64
pub const ZERO_DATA_BYTE_GAS_COST: u64 = 4u64
Intrinsic gas usage for a single zero byte of data.
sourcepub const NONZERO_DATA_BYTE_GAS_COST: u64 = 68u64
pub const NONZERO_DATA_BYTE_GAS_COST: u64 = 68u64
Intrinsic gas usage for a single non-zero byte of data.
sourcepub fn intrinsic_gas(&self) -> u64
pub fn intrinsic_gas(&self) -> u64
Calculate the intrinsic gas amount required for executing this clause.
This amount is always less than actual amount of gas necessary.
More info <https://docs.vechain.org/core-concepts/transactions/transaction-calculation>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Clause
impl<'de> Deserialize<'de> for Clause
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Clause
impl PartialEq for Clause
impl Eq for Clause
impl StructuralEq for Clause
impl StructuralPartialEq for Clause
Auto Trait Implementations§
impl RefUnwindSafe for Clause
impl Send for Clause
impl Sync for Clause
impl Unpin for Clause
impl UnwindSafe for Clause
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.