Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix breaking change introduced with mithril-client-cli using mithril-client library #1398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-client-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -23,9 +23,16 @@ impl MithrilStakeDistributionListCommand {
let params = Arc::new(ConfigParameters::new(
config.try_deserialize::<HashMap<String, String>>()?,
));
// 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(
&params.require("aggregator_endpoint")?,
&params.require("genesis_verification_key")?,
&params.get_or(
"genesis_verification_key",
&fallback_genesis_verification_key,
),
)
.with_logger(logger())
.build()?;
Expand Down
10 changes: 9 additions & 1 deletion mithril-client-cli/src/commands/snapshot/list.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand All @@ -22,9 +23,16 @@ impl SnapshotListCommand {
let params = Arc::new(ConfigParameters::new(
config.try_deserialize::<HashMap<String, String>>()?,
));
// 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(
&params.require("aggregator_endpoint")?,
&params.require("genesis_verification_key")?,
&params.get_or(
"genesis_verification_key",
&fallback_genesis_verification_key,
),
)
.with_logger(logger())
.build()?;
Expand Down
11 changes: 9 additions & 2 deletions mithril-client-cli/src/commands/snapshot/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -29,9 +29,16 @@ impl SnapshotShowCommand {
let params = Arc::new(ConfigParameters::new(
config.try_deserialize::<HashMap<String, String>>()?,
));
// 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(
&params.require("aggregator_endpoint")?,
&params.require("genesis_verification_key")?,
&params.get_or(
"genesis_verification_key",
&fallback_genesis_verification_key,
),
)
.with_logger(logger())
.build()?;
Expand Down
Loading