types

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// MetaNamespaceID is the system's namespace ID that holds information about application's namespaces.
	MetaNamespaceID = "_meta"

	// ConfigNamespaceID is the system's namespace ID that holds the config transaction.
	ConfigNamespaceID = "_config"
	// ConfigKey is the key of the config transaction.
	ConfigKey = "_config"
)

Variables

This section is empty.

Functions

func AreSame

func AreSame(h1, h2 *Height) bool

AreSame returns true if both the heights are either nil or equal.

func NewStatusWithHeight added in v0.1.6

func NewStatusWithHeight(s protoblocktx.Status, blkNum uint64, txNum uint32) *protoblocktx.StatusWithHeight

NewStatusWithHeight creates a protoblocktx.StatusWithHeight with the given values.

func NewStatusWithHeightFromRef added in v0.1.6

func NewStatusWithHeightFromRef(
	s protoblocktx.Status, ref *protocoordinatorservice.TxRef,
) *protoblocktx.StatusWithHeight

NewStatusWithHeightFromRef creates a protoblocktx.StatusWithHeight with the given values.

func TxRef added in v0.1.6

func TxRef(txID string, blockNum uint64, txNum uint32) *protocoordinatorservice.TxRef

TxRef a convenient method to create a full, coordinator's TX reference in a single line.

func Version added in v0.1.4

func Version(version uint64) *uint64

Version is a convenient method to create a version pointer in a single line.

Types

type Height

type Height struct {
	BlockNum uint64
	TxNum    uint32
}

Height represents the height of a transaction in blockchain.

func NewHeight

func NewHeight(blockNum uint64, txNum uint32) *Height

NewHeight constructs a new instance of Height.

func NewHeightFromBytes

func NewHeightFromBytes(b []byte) (*Height, int, error)

NewHeightFromBytes constructs a new instance of Height from serialized bytes.

func NewHeightFromTxRef added in v0.1.6

func NewHeightFromTxRef(ref *protocoordinatorservice.TxRef) *Height

NewHeightFromTxRef constructs a new instance of Height.

func (*Height) Compare

func (h *Height) Compare(h1 *Height) int

Compare returns -1, zero, or +1 based on whether this height is less than, equals to, or greater than the specified height respectively.

func (*Height) String

func (h *Height) String() string

String returns string for printing.

func (*Height) ToBytes

func (h *Height) ToBytes() []byte

ToBytes serializes the Height.

func (*Height) WithStatus added in v0.1.6

WithStatus creates protoblocktx.StatusWithHeight with this height and the given code.

Jump to

Keyboard shortcuts

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