util

package
v0.0.54 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Modules = []string{
	"aclaccesscontrol",
	"authz",
	"acc",
	"bank",
	"capability",
	"distribution",
	"epoch",
	"evidence",
	"evm",
	"feegrant",
	"gov",
	"ibc",
	"mint",
	"oracle",
	"params",
	"slashing",
	"staking",
	"tokenfactory",
	"transfer",
	"upgrade",
	"wasm"}

Functions

func CopyIncr

func CopyIncr(bz []byte) []byte

func IterateWithPrefix

func IterateWithPrefix(prefix, begin, end []byte) ([]byte, []byte)

IterateWithPrefix returns the begin and end keys for an iterator over a domain and prefix.

func Serialize

func Serialize(node types.RawSnapshotNode) []byte

Types

type HashCalculator

type HashCalculator interface {
	HashSingle(data []byte) []byte
	HashTwo(dataA []byte, dataB []byte) []byte
	ComputeHashes() [][]byte
}

HashCalculator defines the interface for calculating chained state hash.

type XorHashCalculator

type XorHashCalculator struct {
	NumBlocksPerWorker int64
	NumOfWorkers       int
	DataCh             chan types.RawSnapshotNode
}

XorHashCalculator is the hash calculator backed by XoR hash.

func NewXorHashCalculator

func NewXorHashCalculator(numBlocksPerWorker int64, numWorkers int, data chan types.RawSnapshotNode) XorHashCalculator

NewXorHashCalculator create a new XorHashCalculator.

func (XorHashCalculator) ComputeHashes

func (x XorHashCalculator) ComputeHashes() [][]byte

func (XorHashCalculator) HashSingle

func (x XorHashCalculator) HashSingle(data []byte) []byte

HashSingle computes the hash of a single data element.

func (XorHashCalculator) HashTwo

func (x XorHashCalculator) HashTwo(dataA []byte, dataB []byte) []byte

HashTwo computes the hash of a two data elements, performs XOR between two byte slices of equal size.

Jump to

Keyboard shortcuts

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