Struct avalanche_types::avax::BaseTx
source · [−]pub struct BaseTx {
pub metadata: Option<Metadata>,
pub network_id: u32,
pub blockchain_id: Id,
pub transferable_outputs: Option<Vec<TransferableOutput>>,
pub transferable_inputs: Option<Vec<TransferableInput>>,
pub memo: Option<Vec<u8>>,
}
Expand description
ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/avm#BaseTx ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/vms/components/avax#BaseTx TODO: use serde custom serializer
Fields
metadata: Option<Metadata>
network_id: u32
blockchain_id: Id
transferable_outputs: Option<Vec<TransferableOutput>>
transferable_inputs: Option<Vec<TransferableInput>>
memo: Option<Vec<u8>>
Implementations
sourceimpl BaseTx
impl BaseTx
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
sourceimpl<'de> Deserialize<'de> for BaseTx
impl<'de> Deserialize<'de> for BaseTx
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>,
impl Eq for BaseTx
impl StructuralEq for BaseTx
impl StructuralPartialEq for BaseTx
Auto Trait Implementations
impl RefUnwindSafe for BaseTx
impl Send for BaseTx
impl Sync for BaseTx
impl Unpin for BaseTx
impl UnwindSafe for BaseTx
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<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,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request