-
Notifications
You must be signed in to change notification settings - Fork 199
/
snapshotPruningStorerMock.go
41 lines (33 loc) · 1.11 KB
/
snapshotPruningStorerMock.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
package testscommon
// SnapshotPruningStorerMock -
type SnapshotPruningStorerMock struct {
*MemDbMock
}
// NewSnapshotPruningStorerMock -
func NewSnapshotPruningStorerMock() *SnapshotPruningStorerMock {
return &SnapshotPruningStorerMock{NewMemDbMock()}
}
// GetFromOldEpochsWithoutAddingToCache -
func (spsm *SnapshotPruningStorerMock) GetFromOldEpochsWithoutAddingToCache(key []byte) ([]byte, error) {
return spsm.Get(key)
}
// PutInEpochWithoutCache -
func (spsm *SnapshotPruningStorerMock) PutInEpochWithoutCache(key []byte, data []byte, _ uint32) error {
return spsm.Put(key, data)
}
// GetFromLastEpoch -
func (spsm *SnapshotPruningStorerMock) GetFromLastEpoch(key []byte) ([]byte, error) {
return spsm.Get(key)
}
// GetFromCurrentEpoch -
func (spsm *SnapshotPruningStorerMock) GetFromCurrentEpoch(key []byte) ([]byte, error) {
return spsm.Get(key)
}
// GetLatestStorageEpoch -
func (spsm *SnapshotPruningStorerMock) GetLatestStorageEpoch() (uint32, error) {
return 0, nil
}
// RemoveFromCurrentEpoch -
func (spsm *SnapshotPruningStorerMock) RemoveFromCurrentEpoch(key []byte) error {
return spsm.Remove(key)
}