Skip to content

Commit

Permalink
flip this inequality (#8904)
Browse files Browse the repository at this point in the history
this is funny
  • Loading branch information
elee1766 authored Dec 16, 2023
1 parent d23f306 commit a53b1d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/health/check_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func checkTime(
timestamp = int(cs)
}
}
if timestamp > seconds {
if timestamp < seconds {
return fmt.Errorf("%w: got ts: %d, need: %d", errTimestampTooOld, timestamp, seconds)
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/rpcdaemon/health/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestProcessHealthcheckIfNeeded_HeadersTests(t *testing.T) {
netApiResponse: hexutil.Uint(1),
netApiError: nil,
ethApiBlockResult: map[string]interface{}{
"timestamp": time.Now().Add(1 * time.Second).Unix(),
"timestamp": uint64(time.Now().Add(-10 * time.Second).Unix()),
},
ethApiBlockError: nil,
ethApiSyncingResult: false,
Expand All @@ -264,7 +264,7 @@ func TestProcessHealthcheckIfNeeded_HeadersTests(t *testing.T) {
netApiResponse: hexutil.Uint(1),
netApiError: nil,
ethApiBlockResult: map[string]interface{}{
"timestamp": uint64(time.Now().Add(1 * time.Hour).Unix()),
"timestamp": uint64(time.Now().Add(-1 * time.Hour).Unix()),
},
ethApiBlockError: nil,
ethApiSyncingResult: false,
Expand Down Expand Up @@ -319,7 +319,7 @@ func TestProcessHealthcheckIfNeeded_HeadersTests(t *testing.T) {
netApiResponse: hexutil.Uint(10),
netApiError: nil,
ethApiBlockResult: map[string]interface{}{
"timestamp": time.Now().Add(1 * time.Second).Unix(),
"timestamp": uint64(time.Now().Add(1 * time.Second).Unix()),
},
ethApiBlockError: nil,
ethApiSyncingResult: false,
Expand Down

0 comments on commit a53b1d8

Please sign in to comment.