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() errorChangeProof
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() boolfunc (proof *ChangeProof) ToProto() *syncpb.ChangeProoffunc (proof *ChangeProof) UnmarshalProto(pbProof *syncpb.ChangeProof) errorChangeProofer
Clearer
Config
func NewConfig() ConfigHasher
Key
func ToKey(keyBytes []byte) Keyfunc ToToken(val byte, tokenSize int) Keyfunc (k Key) Bytes() []bytefunc (k Key) Compare(other Key) intfunc (k Key) Extend(keys ...Key) Keyfunc (k Key) Greater(other Key) boolfunc (k Key) HasPrefix(prefix Key) boolfunc (k Key) HasStrictPrefix(prefix Key) boolfunc (k Key) Length() intfunc (k Key) Less(other Key) boolfunc (k Key) Skip(bitsToSkip int) Keyfunc (k Key) Take(bitsToTake int) Keyfunc (k Key) Token(bitIndex int, tokenSize int) byteKeyChange
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) *MockMerkleDBfunc (m *MockMerkleDB) Clear() errorfunc (m *MockMerkleDB) Close() errorfunc (m *MockMerkleDB) CommitChangeProof(ctx context.Context, proof *ChangeProof) errorfunc (m *MockMerkleDB) CommitRangeProof(ctx context.Context, start, end maybe.Maybe[[]byte], proof *RangeProof) errorfunc (m *MockMerkleDB) Compact(start, limit []byte) errorfunc (m *MockMerkleDB) Delete(key []byte) errorfunc (m *MockMerkleDB) EXPECT() *MockMerkleDBMockRecorderfunc (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.Batchfunc (m *MockMerkleDB) NewIterator() database.Iteratorfunc (m *MockMerkleDB) NewIteratorWithPrefix(prefix []byte) database.Iteratorfunc (m *MockMerkleDB) NewIteratorWithStart(start []byte) database.Iteratorfunc (m *MockMerkleDB) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iteratorfunc (m *MockMerkleDB) NewView(ctx context.Context, changes ViewChanges) (View, error)func (m *MockMerkleDB) PrefetchPath(key []byte) errorfunc (m *MockMerkleDB) PrefetchPaths(keys [][]byte) errorfunc (m *MockMerkleDB) Put(key, value []byte) errorfunc (m *MockMerkleDB) VerifyChangeProof(ctx context.Context, proof *ChangeProof, start, end maybe.Maybe[[]byte], expectedEndRootID ids.ID) errorMockMerkleDBMockRecorder
MockMerkleDBMockRecorder is the mock recorder for MockMerkleDB.
func (mr *MockMerkleDBMockRecorder) Clear() *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Close() *gomock.Callfunc (mr *MockMerkleDBMockRecorder) CommitChangeProof(ctx, proof any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) CommitRangeProof(ctx, start, end, proof any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Compact(start, limit any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Delete(key any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Get(key any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetChangeProof(ctx, startRootID, endRootID, start, end, maxLength any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetMerkleRoot(ctx any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetProof(ctx, keyBytes any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetRangeProof(ctx, start, end, maxLength any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetRangeProofAtRoot(ctx, rootID, start, end, maxLength any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetValue(ctx, key any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) GetValues(ctx, keys any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Has(key any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) HealthCheck(arg0 any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewBatch() *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewIterator() *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewIteratorWithPrefix(prefix any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewIteratorWithStart(start any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewIteratorWithStartAndPrefix(start, prefix any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) NewView(ctx, changes any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) PrefetchPath(key any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) PrefetchPaths(keys any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) Put(key, value any) *gomock.Callfunc (mr *MockMerkleDBMockRecorder) VerifyChangeProof(ctx, proof, start, end, expectedEndRootID any) *gomock.CallPrefetcher
Proof
Proof represents an inclusion/exclusion proof of a key.
func (proof *Proof) ToProto() *syncpb.Prooffunc (proof *Proof) UnmarshalProto(pbProof *syncpb.Proof) errorfunc (proof *Proof) Verify(
ctx context.Context,
expectedRootID ids.ID,
tokenSize int,
hasher Hasher,
) errorProofGetter
ProofNode
func (node *ProofNode) ToProto() *syncpb.ProofNodefunc (node *ProofNode) UnmarshalProto(pbNode *syncpb.ProofNode) errorRangeProof
func (proof *RangeProof) ToProto() *syncpb.RangeProoffunc (proof *RangeProof) UnmarshalProto(pbProof *syncpb.RangeProof) errorfunc (proof *RangeProof) Verify(
ctx context.Context,
start maybe.Maybe[[]byte],
end maybe.Maybe[[]byte],
expectedRootID ids.ID,
tokenSize int,
hasher Hasher,
) error