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: u32blockchain_id: Idtransferable_outputs: Option<Vec<TransferableOutput>>transferable_inputs: Option<Vec<TransferableInput>>memo: Option<Vec<u8>>

Implementations

“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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.