Skip to content

Commit

Permalink
[BACKPORT] #4014: Fix build of client_cli (#4022)
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
  • Loading branch information
mversic authored Nov 6, 2023
1 parent f64586b commit c99039b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions client_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Configuration>,
Expand All @@ -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),
Expand All @@ -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;

Expand Down Expand Up @@ -142,7 +142,7 @@ impl<W: std::io::Write> RunContext for PrintJsonContext<W> {
}

/// Runs subcommand
pub trait RunArgs {
trait RunArgs {
/// Runs command
///
/// # Errors
Expand Down Expand Up @@ -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<Executable>,
metadata: UnlimitedMetadata,
context: &mut dyn RunContext,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tools/kagami/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -33,7 +33,7 @@ fn main() -> Outcome {
}

/// Trait to encapsulate common attributes of the commands and sub-commands.
pub trait RunArgs<T: Write> {
trait RunArgs<T: Write> {
/// Run the given command.
///
/// # Errors
Expand All @@ -45,7 +45,7 @@ pub trait RunArgs<T: Write> {
/// 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<crypto::Args>),
/// Generate the schema used for code generation in Iroha SDKs
Expand Down

0 comments on commit c99039b

Please sign in to comment.