execution_tx

package
v0.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TxType_name = map[int32]string{
		0: "TxType_INVALID",
		1: "TxType_START",
		2: "TxType_SET_OUTPUTS",
		3: "TxType_COMPLETE",
		4: "TxType_APPEND_LOG",
		5: "TxType_CANCEL",
		6: "TxType_RECLAIM",
	}
	TxType_value = map[string]int32{
		"TxType_INVALID":     0,
		"TxType_START":       1,
		"TxType_SET_OUTPUTS": 2,
		"TxType_COMPLETE":    3,
		"TxType_APPEND_LOG":  4,
		"TxType_CANCEL":      5,
		"TxType_RECLAIM":     6,
	}
)

Enum value maps for TxType.

View Source
var ObjectOperationTypeID = "forge/execution/tx"

ObjectOperationTypeID is the transaction object operation type id.

Functions

func LookupWorldOp

func LookupWorldOp(ctx context.Context, opTypeID string) (world.Operation, error)

LookupWorldOp performs the lookup operation for the pass op types.

Types

type ClaimHeldError added in v0.57.0

type ClaimHeldError struct {
	ClaimID string
	Epoch   uint64
}

ClaimHeldError reports that another controller owns the live execution claim.

func (*ClaimHeldError) Error added in v0.57.0

func (e *ClaimHeldError) Error() string

Error returns the claim ownership conflict.

type StaleClaimEpochError added in v0.57.0

type StaleClaimEpochError struct {
	ClaimEpoch   uint64
	CurrentEpoch uint64
}

StaleClaimEpochError reports a write carrying a non-authoritative claim epoch.

func (*StaleClaimEpochError) Error added in v0.57.0

func (e *StaleClaimEpochError) Error() string

Error returns the stale claim epoch conflict.

type Transaction

type Transaction interface {
	// MarshalVT marshals to binary.
	MarshalVT() ([]byte, error)
	// UnmarshalVT unmarshals from binary.
	UnmarshalVT(data []byte) error

	// GetTxType returns the type of transaction this is.
	GetTxType() TxType
	// Validate performs a cursory check of the transaction.
	// Note: this should not fetch network data.
	Validate() error
	// ExecuteTx executes the transaction against the execution instance.
	// exCursor should be located at the execution state root.
	// The result is written into exCursor.
	ExecuteTx(
		ctx context.Context,
		sender peer.ID,
		exCursor *block.Cursor,
		root *forge_execution.Execution,
	) error
}

Transaction is an instance of a transaction object.

func NewTxCancelTxn added in v0.57.0

func NewTxCancelTxn() Transaction

NewTxCancelTxn constructs a cancellation transaction payload.

func NewTxCompleteTxn

func NewTxCompleteTxn() Transaction

NewTxCompleteTxn constructs the COMPLETE transaction.

func NewTxReclaimTxn added in v0.57.0

func NewTxReclaimTxn() Transaction

NewTxReclaimTxn constructs a new RECLAIM transaction.

func NewTxSetOutputsTxn

func NewTxSetOutputsTxn() Transaction

NewTxSetOutputsTxn constructs a new SET_OUTPUTS transaction.

func NewTxStartTxn

func NewTxStartTxn() Transaction

NewTxStartTxn constructs a new START transaction.

type Tx

type Tx struct {

	// TxType is the kind of transaction this is.
	TxType TxType `protobuf:"varint,1,opt,name=tx_type,json=txType,proto3" json:"txType,omitempty"`
	// TxStart contains the start transaction tx.
	// TxType_START
	TxStart *TxStart `protobuf:"bytes,2,opt,name=tx_start,json=txStart,proto3" json:"txStart,omitempty"`
	// TxSetOutputs contains the set outputs tx.
	// TxType_SET_OUTPUTS
	TxSetOutputs *TxSetOutputs `protobuf:"bytes,3,opt,name=tx_set_outputs,json=txSetOutputs,proto3" json:"txSetOutputs,omitempty"`
	// TxComplete contains the complete tx.
	// TxType_COMPLETE
	TxComplete *TxComplete `protobuf:"bytes,4,opt,name=tx_complete,json=txComplete,proto3" json:"txComplete,omitempty"`
	// TxAppendLog contains the append log tx.
	// TxType_APPEND_LOG
	TxAppendLog *TxAppendLog `protobuf:"bytes,5,opt,name=tx_append_log,json=txAppendLog,proto3" json:"txAppendLog,omitempty"`
	// TxCancel contains the cancel tx.
	// TxType_CANCEL
	TxCancel *TxCancel `protobuf:"bytes,6,opt,name=tx_cancel,json=txCancel,proto3" json:"txCancel,omitempty"`
	// TxReclaim transfers a running execution after owner liveness is resolved.
	// TxType_RECLAIM
	TxReclaim *TxReclaim `protobuf:"bytes,7,opt,name=tx_reclaim,json=txReclaim,proto3" json:"txReclaim,omitempty"`
	// contains filtered or unexported fields
}

Tx is the on-the-wire representation of a transaction.

func ByteSliceToTx

func ByteSliceToTx(blk block.Block) (*Tx, error)

ByteSliceToTx converts a byte slice block a Tx. If blk is nil, returns nil, nil If the blk is already parsed to a MockWorldOp, returns the MockWorldOp.

func NewTxAppendLog

func NewTxAppendLog(
	entries []*forge_execution.LogEntry,
	claims ...*forge_execution.Claim,
) (*Tx, error)

NewTxAppendLog constructs an APPEND_LOG transaction. Clones the entries when building the Tx object.

func NewTxCancel added in v0.57.0

func NewTxCancel() *Tx

NewTxCancel constructs a cancellation transaction.

func NewTxComplete

func NewTxComplete(result *forge_value.Result, claims ...*forge_execution.Claim) *Tx

NewTxComplete constructs the COMPLETE transaction.

func NewTxReclaim added in v0.57.0

func NewTxReclaim(peerID peer.ID, claimID string, expectedClaimEpoch uint64) *Tx

NewTxReclaim constructs a RECLAIM transaction.

func NewTxSetOutputs

func NewTxSetOutputs(
	outputs forge_value.ValueSlice,
	clearOld bool,
	claims ...*forge_execution.Claim,
) (*Tx, error)

NewTxSetOutputs constructs a new SET_OUTPUTS transaction. clones the ValueSet when building the Tx object.

func NewTxStart

func NewTxStart(peerID peer.ID, claimIDs ...string) *Tx

NewTxStart constructs a new START transaction.

func (*Tx) ApplyWorldObjectOp

func (t *Tx) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*Tx) ApplyWorldOp

func (t *Tx) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp applies the operation as a world operation. returns false, ErrUnhandledOp if the operation cannot handle a world op

func (*Tx) CloneMessageVT

func (m *Tx) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Tx) CloneVT

func (m *Tx) CloneVT() *Tx

func (*Tx) EqualMessageVT

func (this *Tx) EqualMessageVT(thatMsg any) bool

func (*Tx) EqualVT

func (this *Tx) EqualVT(that *Tx) bool

func (*Tx) GetOperationTypeId

func (t *Tx) GetOperationTypeId() string

GetOperationTypeId returns the operation type identifier.

func (*Tx) GetTxAppendLog

func (x *Tx) GetTxAppendLog() *TxAppendLog

func (*Tx) GetTxCancel added in v0.57.0

func (x *Tx) GetTxCancel() *TxCancel

func (*Tx) GetTxComplete

func (x *Tx) GetTxComplete() *TxComplete

func (*Tx) GetTxReclaim added in v0.57.0

func (x *Tx) GetTxReclaim() *TxReclaim

func (*Tx) GetTxSetOutputs

func (x *Tx) GetTxSetOutputs() *TxSetOutputs

func (*Tx) GetTxStart

func (x *Tx) GetTxStart() *TxStart

func (*Tx) GetTxType

func (x *Tx) GetTxType() TxType

func (*Tx) LocateTx

func (t *Tx) LocateTx() (Transaction, error)

LocateTx returns the sub-block for the transaction.

func (*Tx) MarshalBlock

func (t *Tx) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*Tx) MarshalJSON

func (x *Tx) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tx to JSON.

func (*Tx) MarshalProtoJSON

func (x *Tx) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Tx message to JSON.

func (*Tx) MarshalProtoText

func (x *Tx) MarshalProtoText() string

func (*Tx) MarshalToSizedBufferVT

func (m *Tx) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Tx) MarshalToVT

func (m *Tx) MarshalToVT(dAtA []byte) (int, error)

func (*Tx) MarshalVT

func (m *Tx) MarshalVT() (dAtA []byte, err error)

func (*Tx) ProtoMessage

func (*Tx) ProtoMessage()

func (*Tx) Reset

func (x *Tx) Reset()

func (*Tx) SizeVT

func (m *Tx) SizeVT() (n int)

func (*Tx) String

func (x *Tx) String() string

func (*Tx) UnmarshalBlock

func (t *Tx) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*Tx) UnmarshalJSON

func (x *Tx) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Tx from JSON.

func (*Tx) UnmarshalProtoJSON

func (x *Tx) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Tx message from JSON.

func (*Tx) UnmarshalVT

func (m *Tx) UnmarshalVT(dAtA []byte) error

func (*Tx) Validate

func (t *Tx) Validate() error

Validate checks the tx.

type TxAppendLog

type TxAppendLog struct {

	// Entries is the set of log entries to append.
	Entries []*execution.LogEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// ClaimEpoch is the fencing token authorizing this write.
	ClaimEpoch uint64 `protobuf:"varint,2,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,3,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxAppendLog appends log entries to the execution. Execution must be RUNNING or CANCELING. Sender must be the peer_id specified on the Execution. TxType: TxType_APPEND_LOG

func (*TxAppendLog) CloneMessageVT

func (m *TxAppendLog) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxAppendLog) CloneVT

func (m *TxAppendLog) CloneVT() *TxAppendLog

func (*TxAppendLog) EqualMessageVT

func (this *TxAppendLog) EqualMessageVT(thatMsg any) bool

func (*TxAppendLog) EqualVT

func (this *TxAppendLog) EqualVT(that *TxAppendLog) bool

func (*TxAppendLog) ExecuteTx

func (t *TxAppendLog) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxAppendLog) GetClaimEpoch added in v0.57.0

func (x *TxAppendLog) GetClaimEpoch() uint64

func (*TxAppendLog) GetClaimId added in v0.57.0

func (x *TxAppendLog) GetClaimId() string

func (*TxAppendLog) GetEntries

func (x *TxAppendLog) GetEntries() []*execution.LogEntry

func (*TxAppendLog) GetTxType

func (t *TxAppendLog) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxAppendLog) MarshalJSON

func (x *TxAppendLog) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxAppendLog to JSON.

func (*TxAppendLog) MarshalProtoJSON

func (x *TxAppendLog) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxAppendLog message to JSON.

func (*TxAppendLog) MarshalProtoText

func (x *TxAppendLog) MarshalProtoText() string

func (*TxAppendLog) MarshalToSizedBufferVT

func (m *TxAppendLog) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxAppendLog) MarshalToVT

func (m *TxAppendLog) MarshalToVT(dAtA []byte) (int, error)

func (*TxAppendLog) MarshalVT

func (m *TxAppendLog) MarshalVT() (dAtA []byte, err error)

func (*TxAppendLog) ProtoMessage

func (*TxAppendLog) ProtoMessage()

func (*TxAppendLog) Reset

func (x *TxAppendLog) Reset()

func (*TxAppendLog) SizeVT

func (m *TxAppendLog) SizeVT() (n int)

func (*TxAppendLog) String

func (x *TxAppendLog) String() string

func (*TxAppendLog) UnmarshalJSON

func (x *TxAppendLog) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxAppendLog from JSON.

func (*TxAppendLog) UnmarshalProtoJSON

func (x *TxAppendLog) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxAppendLog message from JSON.

func (*TxAppendLog) UnmarshalVT

func (m *TxAppendLog) UnmarshalVT(dAtA []byte) error

func (*TxAppendLog) Validate

func (t *TxAppendLog) Validate() error

Validate performs a cursory check of the transaction.

type TxCancel added in v0.57.0

type TxCancel struct {
	// contains filtered or unexported fields
}

TxCancel requests cancellation of a running execution. TxType: TxType_CANCEL

func (*TxCancel) CloneMessageVT added in v0.57.0

func (m *TxCancel) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxCancel) CloneVT added in v0.57.0

func (m *TxCancel) CloneVT() *TxCancel

func (*TxCancel) EqualMessageVT added in v0.57.0

func (this *TxCancel) EqualMessageVT(thatMsg any) bool

func (*TxCancel) EqualVT added in v0.57.0

func (this *TxCancel) EqualVT(that *TxCancel) bool

func (*TxCancel) ExecuteTx added in v0.57.0

func (t *TxCancel) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx records a durable cancellation request.

func (*TxCancel) GetTxType added in v0.57.0

func (t *TxCancel) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxCancel) MarshalJSON added in v0.57.0

func (x *TxCancel) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxCancel to JSON.

func (*TxCancel) MarshalProtoJSON added in v0.57.0

func (x *TxCancel) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxCancel message to JSON.

func (*TxCancel) MarshalProtoText added in v0.57.0

func (x *TxCancel) MarshalProtoText() string

func (*TxCancel) MarshalToSizedBufferVT added in v0.57.0

func (m *TxCancel) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxCancel) MarshalToVT added in v0.57.0

func (m *TxCancel) MarshalToVT(dAtA []byte) (int, error)

func (*TxCancel) MarshalVT added in v0.57.0

func (m *TxCancel) MarshalVT() (dAtA []byte, err error)

func (*TxCancel) ProtoMessage added in v0.57.0

func (*TxCancel) ProtoMessage()

func (*TxCancel) Reset added in v0.57.0

func (x *TxCancel) Reset()

func (*TxCancel) SizeVT added in v0.57.0

func (m *TxCancel) SizeVT() (n int)

func (*TxCancel) String added in v0.57.0

func (x *TxCancel) String() string

func (*TxCancel) UnmarshalJSON added in v0.57.0

func (x *TxCancel) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxCancel from JSON.

func (*TxCancel) UnmarshalProtoJSON added in v0.57.0

func (x *TxCancel) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxCancel message from JSON.

func (*TxCancel) UnmarshalVT added in v0.57.0

func (m *TxCancel) UnmarshalVT(dAtA []byte) error

func (*TxCancel) Validate added in v0.57.0

func (t *TxCancel) Validate() error

Validate performs a cursory check of the transaction.

type TxComplete

type TxComplete struct {

	// Result is information about the outcome of a completed execution.
	Result *value.Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// ClaimEpoch is the fencing token authorizing this completion.
	ClaimEpoch uint64 `protobuf:"varint,2,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,3,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxComplete completes the execution by setting the result. Execution must be RUNNING, CANCELING with a canceled result, or COMPLETE with the same claim. Sender must be the peer_id specified on the Execution. TxType: TxType_COMPLETE

func (*TxComplete) CloneMessageVT

func (m *TxComplete) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxComplete) CloneVT

func (m *TxComplete) CloneVT() *TxComplete

func (*TxComplete) EqualMessageVT

func (this *TxComplete) EqualMessageVT(thatMsg any) bool

func (*TxComplete) EqualVT

func (this *TxComplete) EqualVT(that *TxComplete) bool

func (*TxComplete) ExecuteTx

func (t *TxComplete) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxComplete) GetClaimEpoch added in v0.57.0

func (x *TxComplete) GetClaimEpoch() uint64

func (*TxComplete) GetClaimId added in v0.57.0

func (x *TxComplete) GetClaimId() string

func (*TxComplete) GetResult

func (x *TxComplete) GetResult() *value.Result

func (*TxComplete) GetTxType

func (t *TxComplete) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxComplete) MarshalJSON

func (x *TxComplete) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxComplete to JSON.

func (*TxComplete) MarshalProtoJSON

func (x *TxComplete) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxComplete message to JSON.

func (*TxComplete) MarshalProtoText

func (x *TxComplete) MarshalProtoText() string

func (*TxComplete) MarshalToSizedBufferVT

func (m *TxComplete) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxComplete) MarshalToVT

func (m *TxComplete) MarshalToVT(dAtA []byte) (int, error)

func (*TxComplete) MarshalVT

func (m *TxComplete) MarshalVT() (dAtA []byte, err error)

func (*TxComplete) ProtoMessage

func (*TxComplete) ProtoMessage()

func (*TxComplete) Reset

func (x *TxComplete) Reset()

func (*TxComplete) SizeVT

func (m *TxComplete) SizeVT() (n int)

func (*TxComplete) String

func (x *TxComplete) String() string

func (*TxComplete) UnmarshalJSON

func (x *TxComplete) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxComplete from JSON.

func (*TxComplete) UnmarshalProtoJSON

func (x *TxComplete) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxComplete message from JSON.

func (*TxComplete) UnmarshalVT

func (m *TxComplete) UnmarshalVT(dAtA []byte) error

func (*TxComplete) Validate

func (t *TxComplete) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxReclaim added in v0.57.0

type TxReclaim struct {

	// PeerId is the peer identifier to set as the executor.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// ClaimId is the opaque identifier of the new controller instance.
	ClaimId string `protobuf:"bytes,2,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// ExpectedClaimEpoch prevents racing transfers from both succeeding.
	ExpectedClaimEpoch uint64 `protobuf:"varint,3,opt,name=expected_claim_epoch,json=expectedClaimEpoch,proto3" json:"expectedClaimEpoch,omitempty"`
	// contains filtered or unexported fields
}

TxReclaim transfers a RUNNING execution to a new controller instance. The current owner must already be known unavailable by the caller. TxType: TxType_RECLAIM

func (*TxReclaim) CloneMessageVT added in v0.57.0

func (m *TxReclaim) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxReclaim) CloneVT added in v0.57.0

func (m *TxReclaim) CloneVT() *TxReclaim

func (*TxReclaim) EqualMessageVT added in v0.57.0

func (this *TxReclaim) EqualMessageVT(thatMsg any) bool

func (*TxReclaim) EqualVT added in v0.57.0

func (this *TxReclaim) EqualVT(that *TxReclaim) bool

func (*TxReclaim) ExecuteTx added in v0.57.0

func (t *TxReclaim) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxReclaim) GetClaimId added in v0.57.0

func (x *TxReclaim) GetClaimId() string

func (*TxReclaim) GetExpectedClaimEpoch added in v0.57.0

func (x *TxReclaim) GetExpectedClaimEpoch() uint64

func (*TxReclaim) GetPeerId added in v0.57.0

func (x *TxReclaim) GetPeerId() string

func (*TxReclaim) GetTxType added in v0.57.0

func (t *TxReclaim) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxReclaim) MarshalJSON added in v0.57.0

func (x *TxReclaim) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxReclaim to JSON.

func (*TxReclaim) MarshalProtoJSON added in v0.57.0

func (x *TxReclaim) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxReclaim message to JSON.

func (*TxReclaim) MarshalProtoText added in v0.57.0

func (x *TxReclaim) MarshalProtoText() string

func (*TxReclaim) MarshalToSizedBufferVT added in v0.57.0

func (m *TxReclaim) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxReclaim) MarshalToVT added in v0.57.0

func (m *TxReclaim) MarshalToVT(dAtA []byte) (int, error)

func (*TxReclaim) MarshalVT added in v0.57.0

func (m *TxReclaim) MarshalVT() (dAtA []byte, err error)

func (*TxReclaim) ParsePeerID added in v0.57.0

func (t *TxReclaim) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*TxReclaim) ProtoMessage added in v0.57.0

func (*TxReclaim) ProtoMessage()

func (*TxReclaim) Reset added in v0.57.0

func (x *TxReclaim) Reset()

func (*TxReclaim) SizeVT added in v0.57.0

func (m *TxReclaim) SizeVT() (n int)

func (*TxReclaim) String added in v0.57.0

func (x *TxReclaim) String() string

func (*TxReclaim) UnmarshalJSON added in v0.57.0

func (x *TxReclaim) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxReclaim from JSON.

func (*TxReclaim) UnmarshalProtoJSON added in v0.57.0

func (x *TxReclaim) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxReclaim message from JSON.

func (*TxReclaim) UnmarshalVT added in v0.57.0

func (m *TxReclaim) UnmarshalVT(dAtA []byte) error

func (*TxReclaim) Validate added in v0.57.0

func (t *TxReclaim) Validate() error

Validate performs a cursory check of the transaction.

type TxSetOutputs

type TxSetOutputs struct {

	// Outputs is the set of values to set.
	Outputs []*value.Value `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// ClearOld indicates to clear all old output values before setting.
	ClearOld bool `protobuf:"varint,2,opt,name=clear_old,json=clearOld,proto3" json:"clearOld,omitempty"`
	// ClaimEpoch is the fencing token authorizing this write.
	ClaimEpoch uint64 `protobuf:"varint,3,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,4,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxSetOutputs updates the value of one or more execution outputs. Execution must be RUNNING or CANCELING. Sender must be the peer_id specified on the Execution. TxType: TxType_SET_OUTPUTS

func (*TxSetOutputs) CloneMessageVT

func (m *TxSetOutputs) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxSetOutputs) CloneVT

func (m *TxSetOutputs) CloneVT() *TxSetOutputs

func (*TxSetOutputs) EqualMessageVT

func (this *TxSetOutputs) EqualMessageVT(thatMsg any) bool

func (*TxSetOutputs) EqualVT

func (this *TxSetOutputs) EqualVT(that *TxSetOutputs) bool

func (*TxSetOutputs) ExecuteTx

func (t *TxSetOutputs) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxSetOutputs) GetClaimEpoch added in v0.57.0

func (x *TxSetOutputs) GetClaimEpoch() uint64

func (*TxSetOutputs) GetClaimId added in v0.57.0

func (x *TxSetOutputs) GetClaimId() string

func (*TxSetOutputs) GetClearOld

func (x *TxSetOutputs) GetClearOld() bool

func (*TxSetOutputs) GetOutputs

func (x *TxSetOutputs) GetOutputs() []*value.Value

func (*TxSetOutputs) GetTxType

func (t *TxSetOutputs) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxSetOutputs) MarshalJSON

func (x *TxSetOutputs) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxSetOutputs to JSON.

func (*TxSetOutputs) MarshalProtoJSON

func (x *TxSetOutputs) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxSetOutputs message to JSON.

func (*TxSetOutputs) MarshalProtoText

func (x *TxSetOutputs) MarshalProtoText() string

func (*TxSetOutputs) MarshalToSizedBufferVT

func (m *TxSetOutputs) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxSetOutputs) MarshalToVT

func (m *TxSetOutputs) MarshalToVT(dAtA []byte) (int, error)

func (*TxSetOutputs) MarshalVT

func (m *TxSetOutputs) MarshalVT() (dAtA []byte, err error)

func (*TxSetOutputs) ProtoMessage

func (*TxSetOutputs) ProtoMessage()

func (*TxSetOutputs) Reset

func (x *TxSetOutputs) Reset()

func (*TxSetOutputs) SizeVT

func (m *TxSetOutputs) SizeVT() (n int)

func (*TxSetOutputs) String

func (x *TxSetOutputs) String() string

func (*TxSetOutputs) UnmarshalJSON

func (x *TxSetOutputs) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxSetOutputs from JSON.

func (*TxSetOutputs) UnmarshalProtoJSON

func (x *TxSetOutputs) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxSetOutputs message from JSON.

func (*TxSetOutputs) UnmarshalVT

func (m *TxSetOutputs) UnmarshalVT(dAtA []byte) error

func (*TxSetOutputs) Validate

func (t *TxSetOutputs) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxStart

type TxStart struct {

	// PeerId is the peer identifier to set as the executor.
	// Must be the same as the sender of the transaction.
	// Must match peer_id on the Execution if it's not empty.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// ClaimId is the opaque identifier of the claiming controller instance.
	ClaimId string `protobuf:"bytes,2,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxStart starts the execution with a peer id. Execution must be PENDING, or active with the same claim. TxType: TxType_START

func (*TxStart) CloneMessageVT

func (m *TxStart) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxStart) CloneVT

func (m *TxStart) CloneVT() *TxStart

func (*TxStart) EqualMessageVT

func (this *TxStart) EqualMessageVT(thatMsg any) bool

func (*TxStart) EqualVT

func (this *TxStart) EqualVT(that *TxStart) bool

func (*TxStart) ExecuteTx

func (t *TxStart) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxStart) GetClaimId added in v0.57.0

func (x *TxStart) GetClaimId() string

func (*TxStart) GetPeerId

func (x *TxStart) GetPeerId() string

func (*TxStart) GetTxType

func (t *TxStart) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxStart) MarshalJSON

func (x *TxStart) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxStart to JSON.

func (*TxStart) MarshalProtoJSON

func (x *TxStart) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxStart message to JSON.

func (*TxStart) MarshalProtoText

func (x *TxStart) MarshalProtoText() string

func (*TxStart) MarshalToSizedBufferVT

func (m *TxStart) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxStart) MarshalToVT

func (m *TxStart) MarshalToVT(dAtA []byte) (int, error)

func (*TxStart) MarshalVT

func (m *TxStart) MarshalVT() (dAtA []byte, err error)

func (*TxStart) ParsePeerID

func (t *TxStart) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*TxStart) ProtoMessage

func (*TxStart) ProtoMessage()

func (*TxStart) Reset

func (x *TxStart) Reset()

func (*TxStart) SizeVT

func (m *TxStart) SizeVT() (n int)

func (*TxStart) String

func (x *TxStart) String() string

func (*TxStart) UnmarshalJSON

func (x *TxStart) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxStart from JSON.

func (*TxStart) UnmarshalProtoJSON

func (x *TxStart) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxStart message from JSON.

func (*TxStart) UnmarshalVT

func (m *TxStart) UnmarshalVT(dAtA []byte) error

func (*TxStart) Validate

func (t *TxStart) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxType

type TxType int32

TxType indicates the kind of transaction.

const (
	TxType_TxType_INVALID TxType = 0
	// TxType_START starts execution of the transaction.
	TxType_TxType_START TxType = 1
	// TxType_SET_OUTPUTS changes the value of an output.
	TxType_TxType_SET_OUTPUTS TxType = 2
	// TxType_COMPLETE sets the result of the execution.
	TxType_TxType_COMPLETE TxType = 3
	// TxType_APPEND_LOG appends log entries to the execution.
	TxType_TxType_APPEND_LOG TxType = 4
	// TxType_CANCEL requests cancellation and custody drain.
	TxType_TxType_CANCEL TxType = 5
	// TxType_RECLAIM transfers a running execution to a new claim owner.
	TxType_TxType_RECLAIM TxType = 6
)

func (TxType) Enum

func (x TxType) Enum() *TxType

func (TxType) MarshalJSON

func (x TxType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxType to JSON.

func (TxType) MarshalProtoJSON

func (x TxType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxType to JSON.

func (TxType) MarshalProtoText

func (x TxType) MarshalProtoText() string

func (TxType) MarshalText

func (x TxType) MarshalText() ([]byte, error)

MarshalText marshals the TxType to text.

func (TxType) String

func (x TxType) String() string

func (*TxType) UnmarshalJSON

func (x *TxType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxType from JSON.

func (*TxType) UnmarshalProtoJSON

func (x *TxType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxType from JSON.

func (*TxType) UnmarshalText

func (x *TxType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the TxType from text.

func (TxType) Validate

func (t TxType) Validate() error

Validate checks the execution tx type is in range.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL