flip this inequality (#8904)

this is funny
This commit is contained in:
a 2023-12-15 21:52:55 -06:00 committed by GitHub
parent d23f306fc1
commit a53b1d8b29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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)
}

View File

@ -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,
@ -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,
@ -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,