txmetadata

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceTypeUndef = SourceType(iota)
	SourceTypeSequencer
	SourceTypePeer
	SourceTypeAPI
	SourceTypeTxStore
	SourceTypePulled
)

Variables

This section is empty.

Functions

func SplitTxBytesWithMetadata

func SplitTxBytesWithMetadata(txBytesWithMetadata []byte) ([]byte, []byte, error)

SplitTxBytesWithMetadata splits received bytes into two pieces Returns: metadata bytes, txBytes

Types

type PortionInfo

type PortionInfo struct {
	LastIndex uint16
	Index     uint16
}

TransactionMetadata optional data which may be attached to the transaction Wrong metadata or absence of it entirely or in parts cannot damage the network When present, metadata is used for consistency checking and workflow optimization

type SourceType

type SourceType byte

TransactionMetadata optional data which may be attached to the transaction Wrong metadata or absence of it entirely or in parts cannot damage the network When present, metadata is used for consistency checking and workflow optimization

func (SourceType) String

func (s SourceType) String() string

type TransactionMetadata

type TransactionMetadata struct {
	// persistent
	StateRoot      common.VCommitment // not nil may be for branch transactions
	LedgerCoverage *uint64            // not nil may be for sequencer transactions
	SlotInflation  *uint64            // not nil may be for sequencer transactions
	Supply         *uint64            // not nil may be for branch transactions
	// non-persistent
	SourceTypeNonPersistent SourceType // non-persistent, used for internal workflow
	TxBytesReceived         *time.Time // not-persistent, used for metrics
}

TransactionMetadata optional data which may be attached to the transaction Wrong metadata or absence of it entirely or in parts cannot damage the network When present, metadata is used for consistency checking and workflow optimization

func ParseTxMetadata

func ParseTxMetadata(txBytesWithMetadata []byte) ([]byte, *TransactionMetadata, error)

func TransactionMetadataFromBytes

func TransactionMetadataFromBytes(data []byte) (*TransactionMetadata, error)

func (*TransactionMetadata) Bytes

func (m *TransactionMetadata) Bytes() []byte

Bytes of TransactionMetadata is nil-safe

func (*TransactionMetadata) String

func (m *TransactionMetadata) String() string

String returns info of the persistent part

Jump to

Keyboard shortcuts

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