diff --git a/client/db/src/sql/mod.rs b/client/db/src/sql/mod.rs index c81df93fcf..204b8a1af2 100644 --- a/client/db/src/sql/mod.rs +++ b/client/db/src/sql/mod.rs @@ -303,8 +303,8 @@ where } None => { return Err(Error::Protocol(format!( - "Missing ethereum block for hash mismatch {expect_eth_block_hash:?}" - ))) + "Missing ethereum block for hash mismatch {expect_eth_block_hash:?}" + ))) } } } @@ -341,24 +341,17 @@ where is_canon, }) } - Err(FindLogError::NotFound) => { - return Err(Error::Protocol(format!( - "[Metadata] No logs found for hash {:?}", - hash - ))) - } - Err(FindLogError::MultipleLogs) => { - return Err(Error::Protocol(format!( - "[Metadata] Multiple logs found for hash {:?}", - hash - ))) - } + Err(FindLogError::NotFound) => Err(Error::Protocol(format!( + "[Metadata] No logs found for hash {hash:?}", + ))), + Err(FindLogError::MultipleLogs) => Err(Error::Protocol(format!( + "[Metadata] Multiple logs found for hash {hash:?}", + ))), } } else { - return Err(Error::Protocol(format!( - "[Metadata] Failed retrieving header for hash {:?}", - hash - ))); + Err(Error::Protocol(format!( + "[Metadata] Failed retrieving header for hash {hash:?}" + ))) } } diff --git a/template/node/src/eth.rs b/template/node/src/eth.rs index 8f28a4b637..f402df7368 100644 --- a/template/node/src/eth.rs +++ b/template/node/src/eth.rs @@ -37,20 +37,15 @@ pub fn db_config_dir(config: &Configuration) -> PathBuf { } /// Avalailable frontier backend types. -#[derive(Debug, Copy, Clone, clap::ValueEnum)] +#[derive(Debug, Copy, Clone, Default, clap::ValueEnum)] pub enum BackendType { /// Either RocksDb or ParityDb as per inherited from the global backend settings. + #[default] KeyValue, /// Sql database with custom log indexing. Sql, } -impl Default for BackendType { - fn default() -> BackendType { - BackendType::KeyValue - } -} - /// The ethereum-compatibility configuration used to run a node. #[derive(Clone, Debug, clap::Parser)] pub struct EthConfiguration {