Struct avalanche_types::txs::Tx
source · pub struct Tx {
pub metadata: Option<Metadata>,
pub network_id: u32,
pub blockchain_id: Id,
pub transferable_inputs: Option<Vec<Input>>,
pub transferable_outputs: Option<Vec<Output>>,
pub memo: Option<Vec<u8>>,
}
Expand description
Fields§
§metadata: Option<Metadata>
§network_id: u32
§blockchain_id: Id
§transferable_inputs: Option<Vec<Input>>
§transferable_outputs: Option<Vec<Output>>
§memo: Option<Vec<u8>>
Implementations§
source§impl Tx
impl Tx
pub fn default() -> Self
pub fn type_name() -> String
pub fn type_id() -> u32
sourcepub fn pack(&self, codec_version: u16, type_id: u32) -> Result<Packer>
pub fn pack(&self, codec_version: u16, type_id: u32) -> Result<Packer>
“Tx.Unsigned” is implemented by “avax.BaseTx” but for marshal, it’s passed as an interface. Then marshaled via “avalanchego/codec/linearcodec.linearCodec” which then calls “genericCodec.marshal”. ref. “avalanchego/vms/avm.Tx.SignSECP256K1Fx” ref. “avalanchego/codec.manager.Marshal” ref. “avalanchego/codec.manager.Marshal(codecVersion, &t.UnsignedTx)” ref. “avalanchego/codec/linearcodec.linearCodec.MarshalInto” ref. “avalanchego/codec/reflectcodec.genericCodec.MarshalInto” ref. “avalanchego/codec/reflectcodec.genericCodec.marshal”
Returns the packer itself so that the following marshals can reuse.
“BaseTx” is an interface in Go (reflect.Interface) thus the underlying type must be specified by the caller TODO: can we do better in Rust? Go does so with reflect… e.g., pack prefix with the type ID for “avm.BaseTx” (linearCodec.PackPrefix) ref. “avalanchego/codec/linearcodec.linearCodec.MarshalInto” ref. “avalanchego/codec/reflectcodec.genericCodec.MarshalInto”
Trait Implementations§
source§impl<'de> Deserialize<'de> for Tx
impl<'de> Deserialize<'de> for Tx
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>,
impl Eq for Tx
impl StructuralEq for Tx
impl StructuralPartialEq for Tx
Auto Trait Implementations§
impl RefUnwindSafe for Tx
impl Send for Tx
impl Sync for Tx
impl Unpin for Tx
impl UnwindSafe for Tx
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request