mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
Make it clear in CLI that paritydb is experimental (#8152)
* Make it clear in CLI that paritydb is experimental Sadly this is a breaking change for the CLI. * Update client/cli/src/params/database_params.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -165,18 +165,35 @@ impl Into<sc_service::config::RpcMethods> for RpcMethods {
|
||||
}
|
||||
}
|
||||
|
||||
arg_enum! {
|
||||
/// Database backend
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Database {
|
||||
// Facebooks RocksDB
|
||||
RocksDb,
|
||||
// ParityDb. https://github.com/paritytech/parity-db/
|
||||
ParityDb,
|
||||
/// Database backend
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Database {
|
||||
/// Facebooks RocksDB
|
||||
RocksDb,
|
||||
/// ParityDb. https://github.com/paritytech/parity-db/
|
||||
ParityDb,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for Database {
|
||||
type Err = String;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, String> {
|
||||
if s.eq_ignore_ascii_case("rocksdb") {
|
||||
Ok(Self::RocksDb)
|
||||
} else if s.eq_ignore_ascii_case("paritydb-experimental") {
|
||||
Ok(Self::ParityDb)
|
||||
} else {
|
||||
Err(format!("Unknwon variant `{}`, known variants: {:?}", s, Self::variants()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Database {
|
||||
/// Returns all the variants of this enum to be shown in the cli.
|
||||
pub fn variants() -> &'static [&'static str] {
|
||||
&["rocksdb", "paritydb-experimental"]
|
||||
}
|
||||
}
|
||||
|
||||
arg_enum! {
|
||||
/// Whether off-chain workers are enabled.
|
||||
|
||||
Reference in New Issue
Block a user