-
Notifications
You must be signed in to change notification settings - Fork 199
/
roundStub.go
44 lines (36 loc) · 1020 Bytes
/
roundStub.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
package mock
import (
"time"
)
// RoundStub -
type RoundStub struct {
IndexCalled func() int64
TimeDurationCalled func() time.Duration
TimeStampCalled func() time.Time
UpdateRoundCalled func(time.Time, time.Time)
RemainingTimeCalled func(time.Time, time.Duration) time.Duration
}
// Index -
func (rnds *RoundStub) Index() int64 {
return rnds.IndexCalled()
}
// TimeDuration -
func (rnds *RoundStub) TimeDuration() time.Duration {
return rnds.TimeDurationCalled()
}
// TimeStamp -
func (rnds *RoundStub) TimeStamp() time.Time {
return rnds.TimeStampCalled()
}
// UpdateRound -
func (rnds *RoundStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time) {
rnds.UpdateRoundCalled(genesisRoundTimeStamp, timeStamp)
}
// RemainingTime -
func (rnds *RoundStub) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration {
return rnds.RemainingTimeCalled(startTime, maxTime)
}
// IsInterfaceNil --
func (rnds *RoundStub) IsInterfaceNil() bool {
return rnds == nil
}