Documentation
¶
Overview ¶
Package txs is a generated GoMock package.
Index ¶
- Constants
- Variables
- func IsSortedAndUniqueOperations(ops []*Operation, c codec.Manager) bool
- func SortOperations(ops []*Operation, c codec.Manager)
- func SortOperationsWithSigners(ops []*Operation, signers [][]*secp256k1.PrivateKey, codec codec.Manager)
- type BaseTx
- func (t *BaseTx) Bytes() []byte
- func (t *BaseTx) InitRuntime(rt *runtime.Runtime)
- func (t *BaseTx) InitializeRuntime(rt *runtime.Runtime) error
- func (tx *BaseTx) InitializeWithRuntime(rt *runtime.Runtime) error
- func (t *BaseTx) InputIDs() set.Set[ids.ID]
- func (t *BaseTx) InputUTXOs() []*lux.UTXOID
- func (t *BaseTx) NumCredentials() int
- func (t *BaseTx) SetBytes(bytes []byte)
- func (t *BaseTx) Visit(v Visitor) error
- type CreateAssetTx
- func (t *CreateAssetTx) InitRuntime(rt *runtime.Runtime)
- func (t *CreateAssetTx) InitialStates() []*InitialState
- func (t *CreateAssetTx) InitializeRuntime(rt *runtime.Runtime) error
- func (tx *CreateAssetTx) InitializeWithRuntime(rt *runtime.Runtime) error
- func (t *CreateAssetTx) Visit(v Visitor) error
- type ExportTx
- type ImportTx
- func (t *ImportTx) InitRuntime(rt *runtime.Runtime)
- func (t *ImportTx) InitializeRuntime(rt *runtime.Runtime) error
- func (tx *ImportTx) InitializeWithRuntime(rt *runtime.Runtime) error
- func (t *ImportTx) InputIDs() set.Set[ids.ID]
- func (t *ImportTx) InputUTXOs() []*lux.UTXOID
- func (t *ImportTx) NumCredentials() int
- func (t *ImportTx) Visit(v Visitor) error
- type InitialState
- type MockUnsignedTx
- func (m *MockUnsignedTx) Bytes() []byte
- func (m *MockUnsignedTx) EXPECT() *MockUnsignedTxMockRecorder
- func (m *MockUnsignedTx) InitRuntime(arg0 context.Context)
- func (m *MockUnsignedTx) InitializeRuntime(arg0 context.Context) error
- func (m *MockUnsignedTx) InputIDs() set.Set[ids.ID]
- func (m *MockUnsignedTx) InputUTXOs() []*lux.UTXOID
- func (m *MockUnsignedTx) NumCredentials() int
- func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte)
- func (m *MockUnsignedTx) Visit(visitor Visitor) error
- type MockUnsignedTxMockRecorder
- func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InitRuntime(arg0 any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InitializeRuntime(arg0 any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InputIDs() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InputUTXOs() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) NumCredentials() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) SetBytes(unsignedBytes any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) Visit(visitor any) *gomock.Call
- type Operation
- type OperationTx
- func (t *OperationTx) InitRuntime(rt *runtime.Runtime)
- func (t *OperationTx) InitializeRuntime(rt *runtime.Runtime) error
- func (tx *OperationTx) InitializeWithRuntime(rt *runtime.Runtime) error
- func (t *OperationTx) InputIDs() set.Set[ids.ID]
- func (t *OperationTx) InputUTXOs() []*lux.UTXOID
- func (t *OperationTx) NumCredentials() int
- func (t *OperationTx) Operations() []*Operation
- func (t *OperationTx) Visit(v Visitor) error
- type Parser
- type Tx
- func (t *Tx) Bytes() []byte
- func (t *Tx) GossipID() ids.ID
- func (t *Tx) ID() ids.ID
- func (t *Tx) Initialize(c codec.Manager) error
- func (t *Tx) InputIDs() set.Set[ids.ID]
- func (t *Tx) SetBytes(unsignedBytes, signedBytes []byte)
- func (t *Tx) SignNFTFx(c codec.Manager, signers [][]*secp256k1.PrivateKey) error
- func (t *Tx) SignPropertyFx(c codec.Manager, signers [][]*secp256k1.PrivateKey) error
- func (t *Tx) SignSECP256K1Fx(c codec.Manager, signers [][]*secp256k1.PrivateKey) error
- func (t *Tx) Size() int
- func (t *Tx) UTXOs() []*lux.UTXO
- type UnsignedTx
- type Visitor
Constants ¶
const CodecVersion = 0
CodecVersion is the current default codec version
Variables ¶
Functions ¶
func SortOperations ¶
func SortOperationsWithSigners ¶
func SortOperationsWithSigners(ops []*Operation, signers [][]*secp256k1.PrivateKey, codec codec.Manager)
Types ¶
type BaseTx ¶
BaseTx is the basis of all transactions.
func (*BaseTx) InitRuntime ¶ added in v1.22.87
func (*BaseTx) InitializeRuntime ¶ added in v1.22.87
InitializeRuntime initializes the context for this transaction
func (*BaseTx) InitializeWithRuntime ¶ added in v1.22.87
InitializeWithRuntime initializes the transaction with Runtime
func (*BaseTx) InputUTXOs ¶
InputUTXOs returns the UTXOIDs this transaction is consuming
func (*BaseTx) NumCredentials ¶
NumCredentials returns the number of expected credentials
type CreateAssetTx ¶
type CreateAssetTx struct {
BaseTx `serialize:"true"`
Name string `serialize:"true" json:"name"`
Symbol string `serialize:"true" json:"symbol"`
Denomination byte `serialize:"true" json:"denomination"`
States []*InitialState `serialize:"true" json:"initialStates"`
}
CreateAssetTx is a transaction that creates a new asset.
func (*CreateAssetTx) InitRuntime ¶ added in v1.22.87
func (t *CreateAssetTx) InitRuntime(rt *runtime.Runtime)
func (*CreateAssetTx) InitialStates ¶
func (t *CreateAssetTx) InitialStates() []*InitialState
InitialStates track which virtual machines, and the initial state of these machines, this asset uses. The returned array should not be modified.
func (*CreateAssetTx) InitializeRuntime ¶ added in v1.22.87
func (t *CreateAssetTx) InitializeRuntime(rt *runtime.Runtime) error
InitializeRuntime initializes the context for this transaction
func (*CreateAssetTx) InitializeWithRuntime ¶ added in v1.22.87
func (tx *CreateAssetTx) InitializeWithRuntime(rt *runtime.Runtime) error
InitializeWithRuntime initializes the transaction with Runtime
func (*CreateAssetTx) Visit ¶
func (t *CreateAssetTx) Visit(v Visitor) error
type ExportTx ¶
type ExportTx struct {
BaseTx `serialize:"true"`
// Which chain to send the funds to
DestinationChain ids.ID `serialize:"true" json:"destinationChain"`
// The outputs this transaction is sending to the other chain
ExportedOuts []*lux.TransferableOutput `serialize:"true" json:"exportedOutputs"`
}
ExportTx is a transaction that exports an asset to another blockchain.
func (*ExportTx) InitRuntime ¶ added in v1.22.87
func (*ExportTx) InitializeRuntime ¶ added in v1.22.87
InitializeRuntime initializes the context for this transaction
func (*ExportTx) InitializeWithRuntime ¶ added in v1.22.87
InitializeWithRuntime initializes the transaction with Runtime
type ImportTx ¶
type ImportTx struct {
BaseTx `serialize:"true"`
// Which chain to consume the funds from
SourceChain ids.ID `serialize:"true" json:"sourceChain"`
// The inputs to this transaction
ImportedIns []*lux.TransferableInput `serialize:"true" json:"importedInputs"`
}
ImportTx is a transaction that imports an asset from another blockchain.
func (*ImportTx) InitRuntime ¶ added in v1.22.87
func (*ImportTx) InitializeRuntime ¶ added in v1.22.87
InitializeRuntime initializes the context for this transaction
func (*ImportTx) InitializeWithRuntime ¶ added in v1.22.87
InitializeWithRuntime initializes the transaction with Runtime
func (*ImportTx) InputUTXOs ¶
InputUTXOs track which UTXOs this transaction is consuming.
func (*ImportTx) NumCredentials ¶
NumCredentials returns the number of expected credentials
type InitialState ¶
type InitialState struct {
FxIndex uint32 `serialize:"true" json:"fxIndex"`
FxID ids.ID `serialize:"false" json:"fxID"`
Outs []verify.State `serialize:"true" json:"outputs"`
}
func (*InitialState) Compare ¶
func (is *InitialState) Compare(other *InitialState) int
func (*InitialState) InitRuntime ¶ added in v1.22.87
func (is *InitialState) InitRuntime(rt *runtime.Runtime)
func (*InitialState) Sort ¶
func (is *InitialState) Sort(c codec.Manager)
type MockUnsignedTx ¶
type MockUnsignedTx struct {
// contains filtered or unexported fields
}
MockUnsignedTx is a mock of UnsignedTx interface.
func NewMockUnsignedTx ¶
func NewMockUnsignedTx(ctrl *gomock.Controller) *MockUnsignedTx
NewMockUnsignedTx creates a new mock instance.
func (*MockUnsignedTx) EXPECT ¶
func (m *MockUnsignedTx) EXPECT() *MockUnsignedTxMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUnsignedTx) InitRuntime ¶ added in v1.22.87
func (m *MockUnsignedTx) InitRuntime(arg0 context.Context)
InitRuntime mocks base method.
func (*MockUnsignedTx) InitializeRuntime ¶ added in v1.22.87
func (m *MockUnsignedTx) InitializeRuntime(arg0 context.Context) error
InitializeRuntime mocks base method.
func (*MockUnsignedTx) InputIDs ¶
func (m *MockUnsignedTx) InputIDs() set.Set[ids.ID]
InputIDs mocks base method.
func (*MockUnsignedTx) InputUTXOs ¶
func (m *MockUnsignedTx) InputUTXOs() []*lux.UTXOID
InputUTXOs mocks base method.
func (*MockUnsignedTx) NumCredentials ¶
func (m *MockUnsignedTx) NumCredentials() int
NumCredentials mocks base method.
func (*MockUnsignedTx) SetBytes ¶
func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte)
SetBytes mocks base method.
func (*MockUnsignedTx) Visit ¶
func (m *MockUnsignedTx) Visit(visitor Visitor) error
Visit mocks base method.
type MockUnsignedTxMockRecorder ¶
type MockUnsignedTxMockRecorder struct {
// contains filtered or unexported fields
}
MockUnsignedTxMockRecorder is the mock recorder for MockUnsignedTx.
func (*MockUnsignedTxMockRecorder) Bytes ¶
func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call
Bytes indicates an expected call of Bytes.
func (*MockUnsignedTxMockRecorder) InitRuntime ¶ added in v1.22.87
func (mr *MockUnsignedTxMockRecorder) InitRuntime(arg0 any) *gomock.Call
InitRuntime indicates an expected call of InitRuntime.
func (*MockUnsignedTxMockRecorder) InitializeRuntime ¶ added in v1.22.87
func (mr *MockUnsignedTxMockRecorder) InitializeRuntime(arg0 any) *gomock.Call
InitializeRuntime indicates an expected call of InitializeRuntime.
func (*MockUnsignedTxMockRecorder) InputIDs ¶
func (mr *MockUnsignedTxMockRecorder) InputIDs() *gomock.Call
InputIDs indicates an expected call of InputIDs.
func (*MockUnsignedTxMockRecorder) InputUTXOs ¶
func (mr *MockUnsignedTxMockRecorder) InputUTXOs() *gomock.Call
InputUTXOs indicates an expected call of InputUTXOs.
func (*MockUnsignedTxMockRecorder) NumCredentials ¶
func (mr *MockUnsignedTxMockRecorder) NumCredentials() *gomock.Call
NumCredentials indicates an expected call of NumCredentials.
type Operation ¶
type OperationTx ¶
type OperationTx struct {
BaseTx `serialize:"true"`
Ops []*Operation `serialize:"true" json:"operations"`
}
OperationTx is a transaction with no credentials.
func (*OperationTx) InitRuntime ¶ added in v1.22.87
func (t *OperationTx) InitRuntime(rt *runtime.Runtime)
func (*OperationTx) InitializeRuntime ¶ added in v1.22.87
func (t *OperationTx) InitializeRuntime(rt *runtime.Runtime) error
InitializeRuntime initializes the context for this transaction
func (*OperationTx) InitializeWithRuntime ¶ added in v1.22.87
func (tx *OperationTx) InitializeWithRuntime(rt *runtime.Runtime) error
InitializeWithRuntime initializes the transaction with Runtime
func (*OperationTx) InputUTXOs ¶
func (t *OperationTx) InputUTXOs() []*lux.UTXOID
func (*OperationTx) NumCredentials ¶
func (t *OperationTx) NumCredentials() int
NumCredentials returns the number of expected credentials
func (*OperationTx) Operations ¶
func (t *OperationTx) Operations() []*Operation
Operations track which ops this transaction is performing. The returned array should not be modified.
func (*OperationTx) Visit ¶
func (t *OperationTx) Visit(v Visitor) error
type Parser ¶
type Parser interface {
Codec() codec.Manager
GenesisCodec() codec.Manager
CodecRegistry() codec.Registry
GenesisCodecRegistry() codec.Registry
ParseTx(bytes []byte) (*Tx, error)
ParseGenesisTx(bytes []byte) (*Tx, error)
}
func NewCustomParser ¶
type Tx ¶
type Tx struct {
Unsigned UnsignedTx `serialize:"true" json:"unsignedTx"`
Creds []*fxs.FxCredential `serialize:"true" json:"credentials"` // The credentials of this transaction
TxID ids.ID `json:"id"`
// contains filtered or unexported fields
}
Tx is the core operation that can be performed. The tx uses the UTXO model. Specifically, a txs inputs will consume previous txs outputs. A tx will be valid if the inputs have the authority to consume the outputs they are attempting to consume and the inputs consume sufficient state to produce the outputs.
func (*Tx) SignPropertyFx ¶
func (*Tx) SignSECP256K1Fx ¶
type UnsignedTx ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mempool is a generated GoMock package.
|
Package mempool is a generated GoMock package. |
|
mempoolmock
Package mempoolmock is a generated GoMock package.
|
Package mempoolmock is a generated GoMock package. |
|
Package txsmock is a generated GoMock package.
|
Package txsmock is a generated GoMock package. |