-
Notifications
You must be signed in to change notification settings - Fork 199
/
dataTrieTrackerStub.go
50 lines (41 loc) · 1.25 KB
/
dataTrieTrackerStub.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package mock
import (
"github.com/ElrondNetwork/elrond-go/common"
)
// 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
}
// ClearDataCaches -
func (dtts *DataTrieTrackerStub) ClearDataCaches() {
dtts.ClearDataCachesCalled()
}
// DirtyData -
func (dtts *DataTrieTrackerStub) DirtyData() map[string][]byte {
return dtts.DirtyDataCalled()
}
// RetrieveValue -
func (dtts *DataTrieTrackerStub) RetrieveValue(key []byte) ([]byte, error) {
return dtts.RetrieveValueCalled(key)
}
// SaveKeyValue -
func (dtts *DataTrieTrackerStub) SaveKeyValue(key []byte, value []byte) error {
return dtts.SaveKeyValueCalled(key, value)
}
// SetDataTrie -
func (dtts *DataTrieTrackerStub) SetDataTrie(tr common.Trie) {
dtts.SetDataTrieCalled(tr)
}
// DataTrie -
func (dtts *DataTrieTrackerStub) DataTrie() common.Trie {
return dtts.DataTrieCalled()
}
// IsInterfaceNil returns true if there is no value under the interface
func (dtts *DataTrieTrackerStub) IsInterfaceNil() bool {
return dtts == nil
}