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: U256
Amount of funds to spend.
data: Bytes
Contract 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
impl Eq for Clause
impl StructuralPartialEq for Clause
Auto Trait Implementations§
impl !Freeze for Clause
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more