types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 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 CreateStatusWithHeight

func CreateStatusWithHeight(s protoblocktx.Status, blkNum uint64, txNum int) *protoblocktx.StatusWithHeight

CreateStatusWithHeight creates a protoblocktx.StatusWithHeight with the given values.

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 (*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.

type VersionNumber

type VersionNumber uint64

VersionNumber represents a row's version.

func VersionNumberFromBytes

func VersionNumberFromBytes(version []byte) VersionNumber

VersionNumberFromBytes converts a version bytes representation to a number representation.

func (VersionNumber) Bytes

func (v VersionNumber) Bytes() []byte

Bytes converts a version number representation to bytes representation.

Jump to

Keyboard shortcuts

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