-
Notifications
You must be signed in to change notification settings - Fork 199
/
bootstrapStorerMock.go
40 lines (32 loc) · 1.05 KB
/
bootstrapStorerMock.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
package mock
import "github.com/multiversx/mx-chain-go/process/block/bootstrapStorage"
// BoostrapStorerMock -
type BoostrapStorerMock struct {
PutCalled func(round int64, bootData bootstrapStorage.BootstrapData) error
GetCalled func(round int64) (bootstrapStorage.BootstrapData, error)
GetHighestRoundCalled func() int64
SaveLastRoundCalled func(round int64) error
}
// Put -
func (bsm *BoostrapStorerMock) Put(round int64, bootData bootstrapStorage.BootstrapData) error {
return bsm.PutCalled(round, bootData)
}
// Get -
func (bsm *BoostrapStorerMock) Get(round int64) (bootstrapStorage.BootstrapData, error) {
return bsm.GetCalled(round)
}
// GetHighestRound -
func (bsm *BoostrapStorerMock) GetHighestRound() int64 {
return bsm.GetHighestRoundCalled()
}
// SaveLastRound -
func (bsm *BoostrapStorerMock) SaveLastRound(round int64) error {
if bsm.SaveLastRoundCalled != nil {
return bsm.SaveLastRoundCalled(round)
}
return nil
}
// IsInterfaceNil -
func (bsm *BoostrapStorerMock) IsInterfaceNil() bool {
return bsm == nil
}