-
Notifications
You must be signed in to change notification settings - Fork 197
/
storagePruningManagerStub.go
51 lines (42 loc) · 1.64 KB
/
storagePruningManagerStub.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
51
package state
import (
"github.com/ElrondNetwork/elrond-go/common"
"github.com/ElrondNetwork/elrond-go/state"
)
// StoragePruningManagerStub -
type StoragePruningManagerStub struct {
MarkForEvictionCalled func(bytes []byte, bytes2 []byte, hashes common.ModifiedHashes, hashes2 common.ModifiedHashes) error
PruneTrieCalled func(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager, handler state.PruningHandler)
CancelPruneCalled func(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager)
CloseCalled func() error
}
// MarkForEviction -
func (stub *StoragePruningManagerStub) MarkForEviction(bytes []byte, bytes2 []byte, hashes common.ModifiedHashes, hashes2 common.ModifiedHashes) error {
if stub.MarkForEvictionCalled != nil {
return stub.MarkForEvictionCalled(bytes, bytes2, hashes, hashes2)
}
return nil
}
// PruneTrie -
func (stub *StoragePruningManagerStub) PruneTrie(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager, handler state.PruningHandler) {
if stub.PruneTrieCalled != nil {
stub.PruneTrieCalled(rootHash, identifier, tsm, handler)
}
}
// CancelPrune -
func (stub *StoragePruningManagerStub) CancelPrune(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager) {
if stub.CancelPruneCalled != nil {
stub.CancelPruneCalled(rootHash, identifier, tsm)
}
}
// Close -
func (stub *StoragePruningManagerStub) Close() error {
if stub.CloseCalled != nil {
return stub.CloseCalled()
}
return nil
}
// IsInterfaceNil -
func (stub *StoragePruningManagerStub) IsInterfaceNil() bool {
return stub == nil
}