From ae6538865f05f0a2f63288df64735722ae9d63bf Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Wed, 18 Sep 2019 10:28:04 -0600 Subject: [PATCH] [PAN-3158] Add Istanbul block for Goerli Set the fork block for Istanbul on goerli to block #1561651 Signed-off-by: Danno Ferrin --- config/src/main/resources/goerli.json | 1 + .../mainnet/MainnetProtocolScheduleTest.java | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/config/src/main/resources/goerli.json b/config/src/main/resources/goerli.json index 623e7976388..99543bbd536 100644 --- a/config/src/main/resources/goerli.json +++ b/config/src/main/resources/goerli.json @@ -10,6 +10,7 @@ "byzantiumBlock":0, "constantinopleBlock":0, "constantinopleFixBlock":0, + "istanbulBlock":1561651, "clique":{ "blockperiodseconds":15, "epochlength":30000 diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java index ee1b025698f..0a20b507417 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java @@ -100,4 +100,37 @@ public void shouldCreateRopstenConfig() throws Exception { Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()) .isEqualTo("ConstantinopleFix"); } + + @Test + public void shouldCreateGoerliConfig() throws Exception { + final ProtocolSchedule sched = + MainnetProtocolSchedule.fromConfig( + GenesisConfigFile.fromConfig( + Resources.toString( + this.getClass().getResource("/goerli.json"), StandardCharsets.UTF_8)) + .getConfigOptions()); + Assertions.assertThat(sched.getByBlockNumber(0L).getName()).isEqualTo("ConstantinopleFix"); + Assertions.assertThat(sched.getByBlockNumber(1_561_651L).getName()).isEqualTo("Istanbul"); + Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()).isEqualTo("Istanbul"); + } + + @Test + public void shouldCreateRinkebyConfig() throws Exception { + final ProtocolSchedule sched = + MainnetProtocolSchedule.fromConfig( + GenesisConfigFile.fromConfig( + Resources.toString( + this.getClass().getResource("/rinkeby.json"), StandardCharsets.UTF_8)) + .getConfigOptions()); + Assertions.assertThat(sched.getByBlockNumber(0L).getName()).isEqualTo("Frontier"); + Assertions.assertThat(sched.getByBlockNumber(1L).getName()).isEqualTo("Homestead"); + Assertions.assertThat(sched.getByBlockNumber(2L).getName()).isEqualTo("TangerineWhistle"); + Assertions.assertThat(sched.getByBlockNumber(3L).getName()).isEqualTo("SpuriousDragon"); + Assertions.assertThat(sched.getByBlockNumber(1_035_301L).getName()).isEqualTo("Byzantium"); + Assertions.assertThat(sched.getByBlockNumber(3_660_663L).getName()).isEqualTo("Constantinople"); + Assertions.assertThat(sched.getByBlockNumber(4_321_234L).getName()) + .isEqualTo("ConstantinopleFix"); + Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()) + .isEqualTo("ConstantinopleFix"); + } }