From c99039b83b4ab162d0d7f1b571ef695bb02d8c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Ver=C5=A1i=C4=87?= Date: Mon, 6 Nov 2023 09:52:56 +0300 Subject: [PATCH] [BACKPORT] #4014: Fix build of client_cli (#4022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marin Veršić --- client_cli/src/main.rs | 16 ++++++++-------- tools/kagami/src/main.rs | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client_cli/src/main.rs b/client_cli/src/main.rs index b52cc851b3d..3cdbf884aa1 100644 --- a/client_cli/src/main.rs +++ b/client_cli/src/main.rs @@ -46,7 +46,7 @@ impl FromStr for Metadata { /// Client configuration wrapper. Allows getting itself from arguments from cli (from user supplied file). #[derive(Debug, Clone)] -pub struct Configuration(pub ClientConfiguration); +struct Configuration(pub ClientConfiguration); impl FromStr for Configuration { type Err = Error; @@ -62,7 +62,7 @@ impl FromStr for Configuration { /// Iroha CLI Client provides an ability to interact with Iroha Peers Web API without direct network usage. #[derive(StructOpt, Debug)] #[structopt(name = "iroha_client_cli", version = concat!(env!("CARGO_PKG_VERSION")), author)] -pub struct Args { +struct Args { /// Sets a config file path #[structopt(short, long)] config: Option, @@ -80,7 +80,7 @@ pub struct Args { } #[derive(StructOpt, Debug)] -pub enum Subcommand { +enum Subcommand { /// The subcommand related to domains #[clap(subcommand)] Domain(domain::Args), @@ -105,7 +105,7 @@ pub enum Subcommand { } /// Context inside which command is executed -pub trait RunContext { +trait RunContext { /// Get access to configuration fn configuration(&self) -> &ClientConfiguration; @@ -142,7 +142,7 @@ impl RunContext for PrintJsonContext { } /// Runs subcommand -pub trait RunArgs { +trait RunArgs { /// Runs command /// /// # Errors @@ -218,7 +218,7 @@ fn main() -> Result<()> { /// # Errors /// Fails if submitting over network fails #[allow(clippy::shadow_unrelated)] -pub fn submit( +fn submit( instructions: impl Into, metadata: UnlimitedMetadata, context: &mut dyn RunContext, @@ -307,7 +307,7 @@ mod events { } } - pub fn listen(filter: FilterBox, context: &mut dyn RunContext) -> Result<()> { + fn listen(filter: FilterBox, context: &mut dyn RunContext) -> Result<()> { let iroha_client = Client::new(context.configuration())?; eprintln!("Listening to events with filter: {filter:?}"); iroha_client @@ -339,7 +339,7 @@ mod blocks { } } - pub fn listen(height: NonZeroU64, context: &mut dyn RunContext) -> Result<()> { + fn listen(height: NonZeroU64, context: &mut dyn RunContext) -> Result<()> { let iroha_client = Client::new(context.configuration())?; eprintln!("Listening to blocks from height: {height}"); iroha_client diff --git a/tools/kagami/src/main.rs b/tools/kagami/src/main.rs index f34d3715774..f4ed9d40733 100644 --- a/tools/kagami/src/main.rs +++ b/tools/kagami/src/main.rs @@ -22,7 +22,7 @@ pub(crate) type Outcome = color_eyre::Result<()>; // The reason for hard-coding this default is to ensure that the // algorithm is matched to the public key in Ed25519 format. If // you need to change either, you should definitely change both. -pub const DEFAULT_PUBLIC_KEY: &str = +const DEFAULT_PUBLIC_KEY: &str = "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"; fn main() -> Outcome { @@ -33,7 +33,7 @@ fn main() -> Outcome { } /// Trait to encapsulate common attributes of the commands and sub-commands. -pub trait RunArgs { +trait RunArgs { /// Run the given command. /// /// # Errors @@ -45,7 +45,7 @@ pub trait RunArgs { /// shipped with Iroha. #[derive(Parser, Debug)] #[command(name = "kagami", version, author)] -pub enum Args { +enum Args { /// Generate cryptographic key pairs using the given algorithm and either private key or seed Crypto(Box), /// Generate the schema used for code generation in Iroha SDKs