-
Notifications
You must be signed in to change notification settings - Fork 199
/
heartbeatStorerStub.go
52 lines (42 loc) · 1.44 KB
/
heartbeatStorerStub.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
52
package mock
import (
"time"
"github.com/ElrondNetwork/elrond-go/heartbeat/data"
)
// HeartbeatStorerStub -
type HeartbeatStorerStub struct {
LoadGenesisTimeCalled func() (time.Time, error)
UpdateGenesisTimeCalled func(genesisTime time.Time) error
LoadHeartBeatDTOCalled func(pubKey string) (*data.HeartbeatDTO, error)
SavePubkeyDataCalled func(pubkey []byte, heartbeat *data.HeartbeatDTO) error
LoadKeysCalled func() ([][]byte, error)
SaveKeysCalled func(peersSlice [][]byte) error
}
// LoadGenesisTime -
func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error) {
return hss.LoadGenesisTimeCalled()
}
// UpdateGenesisTime -
func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error {
return hss.UpdateGenesisTimeCalled(genesisTime)
}
// LoadHeartBeatDTO -
func (hss *HeartbeatStorerStub) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error) {
return hss.LoadHeartBeatDTOCalled(pubKey)
}
// SavePubkeyData -
func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error {
return hss.SavePubkeyDataCalled(pubkey, heartbeat)
}
// LoadKeys -
func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error) {
return hss.LoadKeysCalled()
}
// SaveKeys -
func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error {
return hss.SaveKeysCalled(peersSlice)
}
// IsInterfaceNil -
func (hss *HeartbeatStorerStub) IsInterfaceNil() bool {
return false
}