Run NodesReferenceX

merkledb

Package merkledb is a generated GoMock package.

import "github.com/luxfi/node/x/merkledb"

Package merkledb is a generated GoMock package.

Types

BranchFactor

func (b BranchFactor) Valid() error

ChangeProof

ChangeProof proves that a set of key-value changes occurred between two trie roots, where each key-value pair's key is between some lower and upper bound (inclusive).

func (proof *ChangeProof) Empty() bool
func (proof *ChangeProof) ToProto() *syncpb.ChangeProof
func (proof *ChangeProof) UnmarshalProto(pbProof *syncpb.ChangeProof) error

ChangeProofer

Clearer

Config

func NewConfig() Config

Hasher

Key

func ToKey(keyBytes []byte) Key
func ToToken(val byte, tokenSize int) Key
func (k Key) Bytes() []byte
func (k Key) Compare(other Key) int
func (k Key) Extend(keys ...Key) Key
func (k Key) Greater(other Key) bool
func (k Key) HasPrefix(prefix Key) bool
func (k Key) HasStrictPrefix(prefix Key) bool
func (k Key) Length() int
func (k Key) Less(other Key) bool
func (k Key) Skip(bitsToSkip int) Key
func (k Key) Take(bitsToTake int) Key
func (k Key) Token(bitIndex int, tokenSize int) byte

KeyChange

MerkleDB

func New(ctx context.Context, db database.Database, config Config) (MerkleDB, error)

MerkleRootGetter

MockMerkleDB

MockMerkleDB is a mock of MerkleDB interface.

func NewMockMerkleDB(ctrl *gomock.Controller) *MockMerkleDB
func (m *MockMerkleDB) Clear() error
func (m *MockMerkleDB) Close() error
func (m *MockMerkleDB) CommitChangeProof(ctx context.Context, proof *ChangeProof) error
func (m *MockMerkleDB) CommitRangeProof(ctx context.Context, start, end maybe.Maybe[[]byte], proof *RangeProof) error
func (m *MockMerkleDB) Compact(start, limit []byte) error
func (m *MockMerkleDB) Delete(key []byte) error
func (m *MockMerkleDB) EXPECT() *MockMerkleDBMockRecorder
func (m *MockMerkleDB) Get(key []byte) ([]byte, error)
func (m *MockMerkleDB) GetChangeProof(ctx context.Context, startRootID, endRootID ids.ID, start, end maybe.Maybe[[]byte], maxLength int) (*ChangeProof, error)
func (m *MockMerkleDB) GetMerkleRoot(ctx context.Context) (ids.ID, error)
func (m *MockMerkleDB) GetProof(ctx context.Context, keyBytes []byte) (*Proof, error)
func (m *MockMerkleDB) GetRangeProof(ctx context.Context, start, end maybe.Maybe[[]byte], maxLength int) (*RangeProof, error)
func (m *MockMerkleDB) GetRangeProofAtRoot(ctx context.Context, rootID ids.ID, start, end maybe.Maybe[[]byte], maxLength int) (*RangeProof, error)
func (m *MockMerkleDB) GetValue(ctx context.Context, key []byte) ([]byte, error)
func (m *MockMerkleDB) GetValues(ctx context.Context, keys [][]byte) ([][]byte, []error)
func (m *MockMerkleDB) Has(key []byte) (bool, error)
func (m *MockMerkleDB) HealthCheck(arg0 context.Context) (any, error)
func (m *MockMerkleDB) NewBatch() database.Batch
func (m *MockMerkleDB) NewIterator() database.Iterator
func (m *MockMerkleDB) NewIteratorWithPrefix(prefix []byte) database.Iterator
func (m *MockMerkleDB) NewIteratorWithStart(start []byte) database.Iterator
func (m *MockMerkleDB) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator
func (m *MockMerkleDB) NewView(ctx context.Context, changes ViewChanges) (View, error)
func (m *MockMerkleDB) PrefetchPath(key []byte) error
func (m *MockMerkleDB) PrefetchPaths(keys [][]byte) error
func (m *MockMerkleDB) Put(key, value []byte) error
func (m *MockMerkleDB) VerifyChangeProof(ctx context.Context, proof *ChangeProof, start, end maybe.Maybe[[]byte], expectedEndRootID ids.ID) error

MockMerkleDBMockRecorder

MockMerkleDBMockRecorder is the mock recorder for MockMerkleDB.

func (mr *MockMerkleDBMockRecorder) Clear() *gomock.Call
func (mr *MockMerkleDBMockRecorder) Close() *gomock.Call
func (mr *MockMerkleDBMockRecorder) CommitChangeProof(ctx, proof any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) CommitRangeProof(ctx, start, end, proof any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) Compact(start, limit any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) Delete(key any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) Get(key any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetChangeProof(ctx, startRootID, endRootID, start, end, maxLength any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetMerkleRoot(ctx any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetProof(ctx, keyBytes any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetRangeProof(ctx, start, end, maxLength any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetRangeProofAtRoot(ctx, rootID, start, end, maxLength any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetValue(ctx, key any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) GetValues(ctx, keys any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) Has(key any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) HealthCheck(arg0 any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewBatch() *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewIterator() *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewIteratorWithPrefix(prefix any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewIteratorWithStart(start any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewIteratorWithStartAndPrefix(start, prefix any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) NewView(ctx, changes any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) PrefetchPath(key any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) PrefetchPaths(keys any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) Put(key, value any) *gomock.Call
func (mr *MockMerkleDBMockRecorder) VerifyChangeProof(ctx, proof, start, end, expectedEndRootID any) *gomock.Call

Prefetcher

Proof

Proof represents an inclusion/exclusion proof of a key.

func (proof *Proof) ToProto() *syncpb.Proof
func (proof *Proof) UnmarshalProto(pbProof *syncpb.Proof) error
func (proof *Proof) Verify(
	ctx context.Context,
	expectedRootID ids.ID,
	tokenSize int,
	hasher Hasher,
) error

ProofGetter

ProofNode

func (node *ProofNode) ToProto() *syncpb.ProofNode
func (node *ProofNode) UnmarshalProto(pbNode *syncpb.ProofNode) error

RangeProof

func (proof *RangeProof) ToProto() *syncpb.RangeProof
func (proof *RangeProof) UnmarshalProto(pbProof *syncpb.RangeProof) error
func (proof *RangeProof) Verify(
	ctx context.Context,
	start maybe.Maybe[[]byte],
	end maybe.Maybe[[]byte],
	expectedRootID ids.ID,
	tokenSize int,
	hasher Hasher,
) error

RangeProofer

TraceLevel

Trie

View

ViewChanges