Fix timestamp validation test (#7124)

* +1 on the timestamp

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
pull/7172/head
Sally MacFarlane 6 months ago committed by GitHub
parent e68c4e1d80
commit 64de9f2eda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/TimestampValidationRuleTest.java

@ -102,7 +102,8 @@ public class TimestampValidationRuleTest {
final BlockHeader parent = headerBuilder.buildHeader();
// Create header for validation with a timestamp in the future (1 second too far away)
headerBuilder.timestamp(parent.getTimestamp() + acceptableClockDrift + 1);
// (+1 to avoid spurious failures)
headerBuilder.timestamp(parent.getTimestamp() + acceptableClockDrift + 2);
final BlockHeader header = headerBuilder.buildHeader();
assertThat(uut00.validate(header, parent)).isFalse();
@ -124,7 +125,7 @@ public class TimestampValidationRuleTest {
TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS));
final BlockHeader parent = headerBuilder.buildHeader();
// Create header for validation with a timestamp in the future (1 second too far away)
// Create header for validation with a timestamp an acceptable amount in the future
// (-1) to prevent spurious failures
headerBuilder.timestamp(parent.getTimestamp() + acceptableClockDrift - 1);
final BlockHeader header = headerBuilder.buildHeader();

Loading…
Cancel
Save