update reference tests to the latest version and include test for gray glacier (#4011)

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>

Co-authored-by: Sally MacFarlane <sally.macfarlane@consensys.net>
pull/4022/head
Daniel Lehrner 2 years ago committed by GitHub
parent 7960dae40d
commit 61fc4e2fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java
  2. 2
      ethereum/referencetests/src/reference-test/external-resources
  3. 15
      ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/mainnet/DifficultyCalculatorTests.java

@ -50,7 +50,7 @@ public class ReferenceTestEnv extends BlockHeader {
@JsonCreator
public ReferenceTestEnv(
@JsonProperty("currentCoinbase") final String coinbase,
@JsonProperty("currentDifficulty") final String difficulty,
@JsonProperty(value = "currentDifficulty", required = false) final String difficulty,
@JsonProperty("currentGasLimit") final String gasLimit,
@JsonProperty("currentNumber") final String number,
@JsonProperty(value = "currentBaseFee", required = false) final String baseFee,
@ -63,7 +63,7 @@ public class ReferenceTestEnv extends BlockHeader {
Hash.EMPTY, // transactionsRoot
Hash.EMPTY, // receiptsRoot
new LogsBloomFilter(),
Difficulty.fromHexString(difficulty),
Optional.ofNullable(difficulty).map(Difficulty::fromHexString).orElse(Difficulty.ZERO),
Long.decode(number),
Long.decode(gasLimit),
0L,

@ -1 +1 @@
Subproject commit a380655e5ffab1a5ea0f4d860224bdb19013f06a
Subproject commit 638da7ca7b2ca371ebb33d7d7d2562981aafd9b2

@ -62,6 +62,21 @@ public class DifficultyCalculatorTests {
.getConfigOptions(),
EvmConfiguration.DEFAULT)
),
Arguments.of(
"/DifficultyTests/dfGrayGlacier/difficultyGrayGlacierForkBlock.json",
MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().grayGlacierBlock(15050000))
),
Arguments.of(
"/DifficultyTests/dfGrayGlacier/difficultyGrayGlacierTimeDiff1.json",
MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().grayGlacierBlock(15050000))
),
Arguments.of(
"/DifficultyTests/dfGrayGlacier/difficultyGrayGlacierTimeDiff2.json",
MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().grayGlacierBlock(15050000))
),
Arguments.of(
"/DifficultyTests/dfArrowGlacier/difficultyArrowGlacierForkBlock.json",
MainnetProtocolSchedule.fromConfig(

Loading…
Cancel
Save