From d650f469f3b4fda2d235981c3957338715bea982 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Thu, 1 Nov 2018 12:04:34 +1000 Subject: [PATCH] Improve error message when genesis file does not match. (#225) --- .../pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java | 3 +-- .../pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java index b54574b720..03e2fad824 100644 --- a/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java +++ b/ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/db/DefaultMutableBlockchain.java @@ -350,8 +350,7 @@ public class DefaultMutableBlockchain implements MutableBlockchain { if (!genesisHash.get().equals(genesisBlock.getHash())) { throw new InvalidConfigurationException( "Supplied genesis block does not match stored chain data.\n" - + "Please ensure the integrity of the file: \'pantheon/ethereum/core/src/main/resources/mainnet.json\'.\n" - + "To set a custom genesis file employ the runtime option \'--genesis=PATH_TO_FILE\'."); + + "Please specify a different data directory with --datadir or specify the original genesis file with --genesis."); } } } diff --git a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java index 77f89fef85..3f49dd456f 100644 --- a/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java +++ b/ethereum/core/src/test/java/tech/pegasys/pantheon/ethereum/db/GenesisBlockMismatchTest.java @@ -92,7 +92,6 @@ public class GenesisBlockMismatchTest { .isThrownBy(() -> blockchain00.setGenesis(genesisBlock01)) .withMessageContaining( "Supplied genesis block does not match stored chain data.\n" - + "Please ensure the integrity of the file: \'pantheon/ethereum/core/src/main/resources/mainnet.json\'.\n" - + "To set a custom genesis file employ the runtime option \'--genesis=PATH_TO_FILE\'."); + + "Please specify a different data directory with --datadir or specify the original genesis file with --genesis."); } }