Repository: paritytech/parity-bitcoin (language: rust)

Issue:
Panic at start
I tested with b938b97 on both --testnet and mainnet.

```
$ target/release/pbtc 
thread 'main' panicked at 'internal error: entered unreachable code: hardcoded above', pbtc/config.rs:202:8
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: std::panicking::try::do_call
             at libstd/panicking.rs:345
   7: pbtc::config::parse
             at pbtc/config.rs:202
             at pbtc/config.rs:61
   8: pbtc::main
             at pbtc/main.rs:54
             at pbtc/main.rs:46
   9: std::rt::lang_start::{{closure}}
             at /rustc/96064eb61dc703c289fae61bdf90593d3e7b2449/src/libstd/rt.rs:74
  10: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
Abort trap: 6

```



Discussion / hints:

Fix patch:
diff --git a/pbtc/config.rs b/pbtc/config.rs
index 99462dcbe..06dc0526d 100644
--- a/pbtc/config.rs
+++ b/pbtc/config.rs
@@ -196,11 +196,11 @@ fn parse_consensus_fork(network: Network, db: &storage::SharedStore, matches: &c
 			return Err(format!("Cannot select '{}' fork with non-empty database of '{}' fork", new_consensus_fork, old_consensus_fork)),
 	}
 
-	Ok(match new_consensus_fork {
-		"btc" => ConsensusFork::BitcoinCore,
-		"bch" => ConsensusFork::BitcoinCash(BitcoinCashConsensusParams::new(network)),
-		_ => unreachable!("hardcoded above"),
-	})
+	return match new_consensus_fork {
+		"btc" => Ok(ConsensusFork::BitcoinCore),
+		"bch" => Ok(ConsensusFork::BitcoinCash(BitcoinCashConsensusParams::new(network))),
+		_ => Err(String::from("Fork mandatory")),
+	};
 }
 
 fn parse_rpc_config(network: Network, matches: &clap::ArgMatches) -> Result<RpcHttpConfig, String> {


Test patch: