trie

package
v1.2.24 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointHashesHolderStub

type CheckpointHashesHolderStub struct {
	PutCalled             func([]byte, common.ModifiedHashes) bool
	RemoveCommittedCalled func([]byte)
	RemoveCalled          func([]byte)
	ShouldCommitCalled    func([]byte) bool
}

CheckpointHashesHolderStub -

func (*CheckpointHashesHolderStub) IsInterfaceNil

func (c *CheckpointHashesHolderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*CheckpointHashesHolderStub) Put

func (c *CheckpointHashesHolderStub) Put(rootHash []byte, hashes common.ModifiedHashes) bool

Put -

func (*CheckpointHashesHolderStub) Remove

func (c *CheckpointHashesHolderStub) Remove(hash []byte)

Remove -

func (*CheckpointHashesHolderStub) RemoveCommitted

func (c *CheckpointHashesHolderStub) RemoveCommitted(lastCommittedRootHash []byte)

RemoveCommitted -

func (*CheckpointHashesHolderStub) ShouldCommit

func (c *CheckpointHashesHolderStub) ShouldCommit(hash []byte) bool

ShouldCommit -

type DataTrieTrackerStub

type DataTrieTrackerStub struct {
	ClearDataCachesCalled func()
	DirtyDataCalled       func() map[string][]byte
	RetrieveValueCalled   func(key []byte) ([]byte, error)
	SaveKeyValueCalled    func(key []byte, value []byte) error
	SetDataTrieCalled     func(tr common.Trie)
	DataTrieCalled        func() common.Trie
}

DataTrieTrackerStub -

func (*DataTrieTrackerStub) ClearDataCaches

func (dtts *DataTrieTrackerStub) ClearDataCaches()

ClearDataCaches -

func (*DataTrieTrackerStub) DataTrie

func (dtts *DataTrieTrackerStub) DataTrie() common.Trie

DataTrie -

func (*DataTrieTrackerStub) DirtyData

func (dtts *DataTrieTrackerStub) DirtyData() map[string][]byte

DirtyData -

func (*DataTrieTrackerStub) IsInterfaceNil

func (dtts *DataTrieTrackerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*DataTrieTrackerStub) RetrieveValue

func (dtts *DataTrieTrackerStub) RetrieveValue(key []byte) ([]byte, error)

RetrieveValue -

func (*DataTrieTrackerStub) SaveKeyValue

func (dtts *DataTrieTrackerStub) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue -

func (*DataTrieTrackerStub) SetDataTrie

func (dtts *DataTrieTrackerStub) SetDataTrie(tr common.Trie)

SetDataTrie -

type TrieStub

type TrieStub struct {
	GetCalled                   func(key []byte) ([]byte, error)
	UpdateCalled                func(key, value []byte) error
	DeleteCalled                func(key []byte) error
	RootCalled                  func() ([]byte, error)
	CommitCalled                func() error
	RecreateCalled              func(root []byte) (common.Trie, error)
	GetObsoleteHashesCalled     func() [][]byte
	AppendToOldHashesCalled     func([][]byte)
	GetSerializedNodesCalled    func([]byte, uint64) ([][]byte, uint64, error)
	GetAllHashesCalled          func() ([][]byte, error)
	GetAllLeavesOnChannelCalled func(rootHash []byte) (chan core.KeyValueHolder, error)
	GetProofCalled              func(key []byte) ([][]byte, []byte, error)
	VerifyProofCalled           func(rootHash []byte, key []byte, proof [][]byte) (bool, error)
	GetStorageManagerCalled     func() common.StorageManager
	GetSerializedNodeCalled     func(bytes []byte) ([]byte, error)
	GetNumNodesCalled           func() common.NumNodesDTO
	GetOldRootCalled            func() []byte
	CloseCalled                 func() error
}

TrieStub -

func (*TrieStub) Close

func (ts *TrieStub) Close() error

Close -

func (*TrieStub) Commit

func (ts *TrieStub) Commit() error

Commit -

func (*TrieStub) Delete

func (ts *TrieStub) Delete(key []byte) error

Delete -

func (*TrieStub) Get

func (ts *TrieStub) Get(key []byte) ([]byte, error)

Get -

func (*TrieStub) GetAllHashes

func (ts *TrieStub) GetAllHashes() ([][]byte, error)

GetAllHashes -

func (*TrieStub) GetAllLeavesOnChannel

func (ts *TrieStub) GetAllLeavesOnChannel(rootHash []byte) (chan core.KeyValueHolder, error)

GetAllLeavesOnChannel -

func (*TrieStub) GetDirtyHashes

func (ts *TrieStub) GetDirtyHashes() (common.ModifiedHashes, error)

GetDirtyHashes -

func (*TrieStub) GetNumNodes

func (ts *TrieStub) GetNumNodes() common.NumNodesDTO

GetNumNodes -

func (*TrieStub) GetObsoleteHashes

func (ts *TrieStub) GetObsoleteHashes() [][]byte

GetObsoleteHashes resets the oldHashes and oldRoot variables and returns the old hashes

func (*TrieStub) GetOldRoot

func (ts *TrieStub) GetOldRoot() []byte

GetOldRoot -

func (*TrieStub) GetProof

func (ts *TrieStub) GetProof(key []byte) ([][]byte, []byte, error)

GetProof -

func (*TrieStub) GetSerializedNode

func (ts *TrieStub) GetSerializedNode(bytes []byte) ([]byte, error)

GetSerializedNode -

func (*TrieStub) GetSerializedNodes

func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, uint64, error)

GetSerializedNodes -

func (*TrieStub) GetStorageManager

func (ts *TrieStub) GetStorageManager() common.StorageManager

GetStorageManager -

func (*TrieStub) IsInterfaceNil

func (ts *TrieStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TrieStub) Recreate

func (ts *TrieStub) Recreate(root []byte) (common.Trie, error)

Recreate -

func (*TrieStub) RootHash

func (ts *TrieStub) RootHash() ([]byte, error)

RootHash -

func (*TrieStub) SetNewHashes

func (ts *TrieStub) SetNewHashes(_ common.ModifiedHashes)

SetNewHashes -

func (*TrieStub) String

func (ts *TrieStub) String() string

String -

func (*TrieStub) Update

func (ts *TrieStub) Update(key, value []byte) error

Update -

func (*TrieStub) VerifyProof

func (ts *TrieStub) VerifyProof(rootHash []byte, key []byte, proof [][]byte) (bool, error)

VerifyProof -

type TriesHolderStub

type TriesHolderStub struct {
	PutCalled    func([]byte, common.Trie)
	RemoveCalled func([]byte, common.Trie)
	GetCalled    func([]byte) common.Trie
	GetAllCalled func() []common.Trie
	ResetCalled  func()
}

TriesHolderStub -

func (*TriesHolderStub) Get

func (ths *TriesHolderStub) Get(key []byte) common.Trie

Get -

func (*TriesHolderStub) GetAll

func (ths *TriesHolderStub) GetAll() []common.Trie

GetAll -

func (*TriesHolderStub) IsInterfaceNil

func (ths *TriesHolderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TriesHolderStub) Put

func (ths *TriesHolderStub) Put(key []byte, trie common.Trie)

Put -

func (*TriesHolderStub) Replace

func (ths *TriesHolderStub) Replace(key []byte, trie common.Trie)

Replace -

func (*TriesHolderStub) Reset

func (ths *TriesHolderStub) Reset()

Reset -

Jump to

Keyboard shortcuts

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