Enum TransactionData

Source
pub enum TransactionData {
    V1(TransactionDataV1),
}
Expand description

The payload that gets sent to the full node as base64 BCS bytes.

Variants§

Implementations§

Source§

impl TransactionData

Source

pub fn digest(&self) -> TransactionDigest

Available on crate feature hash only.
Source§

impl TransactionData

Source

pub fn signing_digest(&self) -> SigningDigest

Available on crate feature hash only.
Source§

impl TransactionData

Source

pub const fn v1( kind: TransactionKind, sender: Address, gas_data: GasData, expiration: TransactionExpiration, ) -> Self

Create a new transaction (V1).

Source

pub const fn as_v1(&self) -> &TransactionDataV1

Get the underlying variant.

Since the enum is not #[non_exhaustive] today, this returns a reference. If and when a new version is introduced, there will have to be a SemVer-breaking update anyway and this method will return an option.

Source

pub fn encode_base64(&self) -> String

The payload that gets sent to the full node.

Source

pub fn decode_base64( &self, value: impl AsRef<[u8]>, ) -> Result<Self, TransactionFromBase64Error>

👎Deprecated: Unnecessary &self; will be removed with the next breaking change

Deserialize a transaction from base64 bytes.

Trait Implementations§

Source§

impl Clone for TransactionData

Source§

fn clone(&self) -> TransactionData

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 TransactionData

Source§

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

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

impl<'de> Deserialize<'de> for TransactionData

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<Transaction> for TransactionData

Source§

fn from(_: Transaction) -> Self

Converts to this type from the input type.
Source§

impl From<TransactionData> for Transaction

Source§

fn from(TransactionData::V1: TransactionData) -> Self

Converts to this type from the input type.
Source§

impl From<TransactionDataV1> for TransactionData

Source§

fn from(v: TransactionDataV1) -> TransactionData

Converts to this type from the input type.
Source§

impl PartialEq for TransactionData

Source§

fn eq(&self, other: &TransactionData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TransactionData

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 TransactionDataAPI for TransactionData

Source§

fn is_end_of_epoch_tx(&self) -> bool

returns true if the transaction is one that is specially sequenced to run at the very end of the epoch

Source§

fn is_sponsored_tx(&self) -> bool

Check if the transaction is sponsored (namely gas owner != sender)

Source§

fn sender(&self) -> Address

Source§

fn kind(&self) -> &TransactionKind

Source§

fn kind_mut(&mut self) -> &mut TransactionKind

Source§

fn into_kind(self) -> TransactionKind

Source§

fn gas_data(&self) -> &GasData

Source§

fn gas_owner(&self) -> Address

Source§

fn gas(&self) -> &[ObjectRef]

Source§

fn gas_price(&self) -> u64

Source§

fn gas_budget(&self) -> u64

Source§

fn expiration(&self) -> &TransactionExpiration

Source§

fn is_system_tx(&self) -> bool

Source§

fn is_genesis_tx(&self) -> bool

Source§

fn gas_data_mut(&mut self) -> &mut GasData

Source§

impl TryInto<TransactionDataV1> for TransactionData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TransactionDataV1, <Self as TryInto<TransactionDataV1>>::Error>

Performs the conversion.
Source§

impl Eq for TransactionData

Source§

impl StructuralPartialEq for TransactionData

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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

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

Source§

fn vzip(self) -> V

Source§

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