diff --git a/client/src/client.rs b/client/src/client.rs index fcd84d8f9ec..cb47273f867 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -256,7 +256,9 @@ where fn next(&mut self) -> Option { if self.client_cursor >= self.iter.len() { - let iroha_data_model::query::QueryRequest::Cursor(cursor) = &self.query_handler.query_request.request else { + let iroha_data_model::query::QueryRequest::Cursor(cursor) = + &self.query_handler.query_request.request + else { return None; }; if cursor.cursor().is_none() { @@ -387,9 +389,9 @@ impl QueryRequest { match self.request { iroha_data_model::query::QueryRequest::Query(query_with_params) => builder - .params(Vec::from(query_with_params.sorting)) - .params(Vec::from(query_with_params.pagination)) - .body(query_with_params.query), + .params(Vec::from(query_with_params.sorting().clone())) + .params(Vec::from(*query_with_params.pagination())) + .body(query_with_params.query().clone()), iroha_data_model::query::QueryRequest::Cursor(cursor) => { builder.params(Vec::from(cursor)) } @@ -809,11 +811,7 @@ impl Client { torii_url: self.torii_url.clone(), headers: self.headers.clone(), request: iroha_data_model::query::QueryRequest::Query( - iroha_data_model::query::QueryWithParameters { - query: request, - pagination, - sorting, - }, + iroha_data_model::query::QueryWithParameters::new(request, sorting, pagination), ), }; 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/data_model/src/query/mod.rs b/data_model/src/query/mod.rs index 44ad2274cda..f9e8d266511 100644 --- a/data_model/src/query/mod.rs +++ b/data_model/src/query/mod.rs @@ -176,7 +176,7 @@ pub mod model { /// Query with parameters client can specify. #[derive( - Debug, Constructor, Getters, Clone, PartialEq, Eq, Encode, Decode, Serialize, Deserialize, + Clone, Debug, PartialEq, Eq, Constructor, Getters, Encode, Decode, Serialize, Deserialize, )] #[getset(get = "pub")] pub struct QueryWithParameters { 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