Skip to content

Commit 7dc66fd

Browse files
committed
fixed linter
1 parent d66e7bf commit 7dc66fd

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

epochStart/mock/rounderStub.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
type RoundHandlerStub struct {
99
RoundIndex int64
1010

11-
IndexCalled func() int64
12-
TimeDurationCalled func() time.Duration
13-
TimeStampCalled func() time.Time
14-
UpdateRoundCalled func(time.Time, time.Time)
15-
RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration
11+
IndexCalled func() int64
12+
TimeDurationCalled func() time.Duration
13+
TimeStampCalled func() time.Time
14+
UpdateRoundCalled func(time.Time, time.Time)
15+
RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration
16+
GetTimeStampForRoundCalled func(round uint64) uint64
1617
}
1718

1819
// Index -
@@ -61,6 +62,15 @@ func (rndm *RoundHandlerStub) RemainingTime(startTime time.Time, maxTime time.Du
6162
return 4000 * time.Millisecond
6263
}
6364

65+
// GetTimeStampForRound -
66+
func (rndm *RoundHandlerStub) GetTimeStampForRound(round uint64) uint64 {
67+
if rndm.GetTimeStampForRoundCalled != nil {
68+
return rndm.GetTimeStampForRoundCalled(round)
69+
}
70+
71+
return uint64(time.Unix(0, 0).UnixMilli())
72+
}
73+
6474
// IsInterfaceNil returns true if there is no value under the interface
6575
func (rndm *RoundHandlerStub) IsInterfaceNil() bool {
6676
return rndm == nil

process/mock/roundStub.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import (
66

77
// RoundStub -
88
type RoundStub struct {
9-
IndexCalled func() int64
10-
TimeDurationCalled func() time.Duration
11-
TimeStampCalled func() time.Time
12-
UpdateRoundCalled func(time.Time, time.Time)
13-
RemainingTimeCalled func(time.Time, time.Duration) time.Duration
9+
IndexCalled func() int64
10+
TimeDurationCalled func() time.Duration
11+
TimeStampCalled func() time.Time
12+
UpdateRoundCalled func(time.Time, time.Time)
13+
RemainingTimeCalled func(time.Time, time.Duration) time.Duration
14+
GetTimeStampForRoundCalled func(round uint64) uint64
1415
}
1516

1617
// Index -
@@ -38,6 +39,15 @@ func (rnds *RoundStub) RemainingTime(startTime time.Time, maxTime time.Duration)
3839
return rnds.RemainingTimeCalled(startTime, maxTime)
3940
}
4041

42+
// GetTimeStampForRound -
43+
func (rnds *RoundStub) GetTimeStampForRound(round uint64) uint64 {
44+
if rnds.GetTimeStampForRoundCalled != nil {
45+
return rnds.GetTimeStampForRoundCalled(round)
46+
}
47+
48+
return uint64(time.Unix(0, 0).UnixMilli())
49+
}
50+
4151
// IsInterfaceNil --
4252
func (rnds *RoundStub) IsInterfaceNil() bool {
4353
return rnds == nil

0 commit comments

Comments
 (0)