diff --git a/Cargo.lock b/Cargo.lock index dce6a4ab2f5..8f662637a02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3300,7 +3300,7 @@ dependencies = [ [[package]] name = "mithril-client-cli" -version = "0.5.9" +version = "0.5.10" dependencies = [ "anyhow", "async-recursion", diff --git a/mithril-client-cli/Cargo.toml b/mithril-client-cli/Cargo.toml index 4152ee862cf..ee1bb6521f5 100644 --- a/mithril-client-cli/Cargo.toml +++ b/mithril-client-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-client-cli" -version = "0.5.9" +version = "0.5.10" description = "A Mithril Client" authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-client-cli/src/commands/mithril_stake_distribution/list.rs b/mithril-client-cli/src/commands/mithril_stake_distribution/list.rs index ff00173c409..3fb8d26bb58 100644 --- a/mithril-client-cli/src/commands/mithril_stake_distribution/list.rs +++ b/mithril-client-cli/src/commands/mithril_stake_distribution/list.rs @@ -6,7 +6,7 @@ use std::{collections::HashMap, sync::Arc}; use mithril_client::ClientBuilder; use mithril_client_cli::configuration::ConfigParameters; -use mithril_common::StdResult; +use mithril_common::{test_utils::fake_keys, StdResult}; /// Mithril stake distribution LIST command #[derive(Parser, Debug, Clone)] @@ -23,9 +23,16 @@ impl MithrilStakeDistributionListCommand { let params = Arc::new(ConfigParameters::new( config.try_deserialize::>()?, )); + // TODO: This should not be done this way. + // Now that mithril-client-cli uses the mithril-client library, the genesis verification key is required for all commands + let fallback_genesis_verification_key = + fake_keys::genesis_verification_key()[0].to_string(); let client = ClientBuilder::aggregator( ¶ms.require("aggregator_endpoint")?, - ¶ms.require("genesis_verification_key")?, + ¶ms.get_or( + "genesis_verification_key", + &fallback_genesis_verification_key, + ), ) .with_logger(logger()) .build()?; diff --git a/mithril-client-cli/src/commands/snapshot/list.rs b/mithril-client-cli/src/commands/snapshot/list.rs index e27124992b8..3d93ab227ce 100644 --- a/mithril-client-cli/src/commands/snapshot/list.rs +++ b/mithril-client-cli/src/commands/snapshot/list.rs @@ -1,6 +1,7 @@ use clap::Parser; use cli_table::{format::Justify, print_stdout, Cell, Table}; use config::{builder::DefaultState, ConfigBuilder}; +use mithril_common::test_utils::fake_keys; use slog_scope::logger; use std::{collections::HashMap, sync::Arc}; @@ -22,9 +23,16 @@ impl SnapshotListCommand { let params = Arc::new(ConfigParameters::new( config.try_deserialize::>()?, )); + // TODO: This should not be done this way. + // Now that mithril-client-cli uses the mithril-client library, the genesis verification key is required for all commands + let fallback_genesis_verification_key = + fake_keys::genesis_verification_key()[0].to_string(); let client = ClientBuilder::aggregator( ¶ms.require("aggregator_endpoint")?, - ¶ms.require("genesis_verification_key")?, + ¶ms.get_or( + "genesis_verification_key", + &fallback_genesis_verification_key, + ), ) .with_logger(logger()) .build()?; diff --git a/mithril-client-cli/src/commands/snapshot/show.rs b/mithril-client-cli/src/commands/snapshot/show.rs index 5d386166a3e..fc92513f5e5 100644 --- a/mithril-client-cli/src/commands/snapshot/show.rs +++ b/mithril-client-cli/src/commands/snapshot/show.rs @@ -7,7 +7,7 @@ use std::{collections::HashMap, sync::Arc}; use mithril_client::ClientBuilder; use mithril_client_cli::{configuration::ConfigParameters, utils::ExpanderUtils}; -use mithril_common::StdResult; +use mithril_common::{test_utils::fake_keys, StdResult}; /// Clap command to show a given snapshot #[derive(Parser, Debug, Clone)] @@ -29,9 +29,16 @@ impl SnapshotShowCommand { let params = Arc::new(ConfigParameters::new( config.try_deserialize::>()?, )); + // TODO: This should not be done this way. + // Now that mithril-client-cli uses the mithril-client library, the genesis verification key is required for all commands + let fallback_genesis_verification_key = + fake_keys::genesis_verification_key()[0].to_string(); let client = ClientBuilder::aggregator( ¶ms.require("aggregator_endpoint")?, - ¶ms.require("genesis_verification_key")?, + ¶ms.get_or( + "genesis_verification_key", + &fallback_genesis_verification_key, + ), ) .with_logger(logger()) .build()?;