version

package
v0.0.0-...-9b7ba46 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreSame

func AreSame(h1 *Height, h2 *Height) bool

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

Types

type Height

type Height struct {
	BlockNum uint64
	TxNum    uint64
}

Height represents the height of a transaction in blockchain

func NewHeight

func NewHeight(blockNum, txNum uint64) *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 return a -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

Jump to

Keyboard shortcuts

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