transaction

package
v0.12.1-0...-5930ee3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec[T Tx] interface {
	// Decode decodes the tx bytes into a DecodedTx, containing
	// both concrete and bytes representation of the tx.
	Decode([]byte) (T, error)
	// DecodeJSON decodes the tx JSON bytes into a DecodedTx
	DecodeJSON([]byte) (T, error)
}

Codec defines the TX codec, which converts a TX from bytes to its concrete representation.

type ExecMode

type ExecMode uint8

ExecMode defines the execution mode

const (
	ExecModeCheck ExecMode = iota
	ExecModeReCheck
	ExecModeSimulate

	ExecModeFinalize
)

All possible execution modes. For backwards compatibility and easier casting, the exec mode values must be the same as in cosmos/cosmos-sdk/types package.

type Identity

type Identity = []byte

type Msg

type Msg = gogoproto.Message

type Service

type Service interface {
	ExecMode(ctx context.Context) ExecMode
}

Service creates a transaction service.

type Tx

type Tx interface {
	// Hash returns the unique identifier for the Tx.
	Hash() [32]byte
	// GetMessages returns the list of state transitions of the Tx.
	GetMessages() ([]Msg, error)
	// GetSenders returns the tx state transition sender.
	GetSenders() ([]Identity, error) // TODO reduce this to a single identity if accepted
	// GetGasLimit returns the gas limit of the tx. Must return math.MaxUint64 for infinite gas
	// txs.
	GetGasLimit() (uint64, error)
	// Bytes returns the encoded version of this tx. Note: this is ideally cached
	// from the first instance of the decoding of the tx.
	Bytes() []byte
}

Jump to

Keyboard shortcuts

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