diff --git a/crates/iroha/tests/upgrade.rs b/crates/iroha/tests/upgrade.rs index 6478c0c3d4e..734442da663 100644 --- a/crates/iroha/tests/upgrade.rs +++ b/crates/iroha/tests/upgrade.rs @@ -412,13 +412,11 @@ fn upgrade_executor(client: &Client, executor: impl AsRef) -> Result<()> { let profile = load_wasm_build_profile(); if !profile.is_optimized() { - client.submit_all_blocking::([ - InstructionBox::SetParameter(SetParameter::new( - Parameter::Executor(SmartContractParameter::Fuel( - std::num::NonZeroU64::new(80_000_000_u64).expect("Fuel must be positive."), - )) - )) - ])?; + client.submit_all_blocking::([InstructionBox::SetParameter( + SetParameter::new(Parameter::Executor(SmartContractParameter::Fuel( + std::num::NonZeroU64::new(80_000_000_u64).expect("Fuel must be positive."), + ))), + )])?; } client.submit_blocking(upgrade_executor)?; diff --git a/crates/iroha_core/src/smartcontracts/wasm/cache.rs b/crates/iroha_core/src/smartcontracts/wasm/cache.rs index c3cf72652ad..ac93f668726 100644 --- a/crates/iroha_core/src/smartcontracts/wasm/cache.rs +++ b/crates/iroha_core/src/smartcontracts/wasm/cache.rs @@ -12,7 +12,7 @@ use crate::{ /// Executor related things (linker initialization, module instantiation, memory free) /// takes significant amount of time in case of single peer transactions handling. -/// (https://github.com/hyperledger/iroha/issues/3716#issuecomment-2348417005). +/// (https://github.com/hyperledger-iroha/iroha/issues/3716#issuecomment-2348417005). /// So this cache is used to share `Store` and `Instance` for different transaction validation. #[derive(Default)] pub struct WasmCache<'world, 'block, 'state> { diff --git a/crates/iroha_test_samples/src/lib.rs b/crates/iroha_test_samples/src/lib.rs index c781285be4c..9884762c53a 100644 --- a/crates/iroha_test_samples/src/lib.rs +++ b/crates/iroha_test_samples/src/lib.rs @@ -1,6 +1,7 @@ //! Utility crate for standardized and random signatories. use std::{ + fs, io::Read, path::{Path, PathBuf}, sync::LazyLock, @@ -9,7 +10,6 @@ use std::{ use iroha_crypto::KeyPair; use iroha_data_model::prelude::{AccountId, WasmSmartContract}; use iroha_wasm_builder::Profile; -use std::fs; /// Generate [`AccountId`](iroha_data_model::account::AccountId) in the given `domain`. /// @@ -150,11 +150,15 @@ pub fn load_wasm_build_profile() -> Profile { panic!("could not read WASM build profile"); } Ok(content) => { - let parsed: toml::Value = toml::from_str(content.as_str()).expect("must parse config file"); - let profile_str = parsed.get("profile") - .and_then(toml::Value::as_str) - .expect("profile must be present in config"); - profile_str.parse().expect(format!("unrecognized profile {profile_str}").as_str()) + let parsed: toml::Value = + toml::from_str(content.as_str()).expect("must parse config file"); + let profile_str = parsed + .get("profile") + .and_then(toml::Value::as_str) + .expect("profile must be present in config"); + profile_str + .parse() + .unwrap_or_else(|_| panic!("unrecognized profile {profile_str}")) } } -} \ No newline at end of file +} diff --git a/crates/iroha_wasm_builder/src/lib.rs b/crates/iroha_wasm_builder/src/lib.rs index 498272c04c5..f72b31756ef 100644 --- a/crates/iroha_wasm_builder/src/lib.rs +++ b/crates/iroha_wasm_builder/src/lib.rs @@ -30,7 +30,7 @@ pub enum Profile { impl Profile { /// Checks whether profile uses optimizations from wasm-opt pub fn is_optimized(self) -> bool { - return self == Profile::Deploy; + self == Profile::Deploy } } @@ -40,7 +40,7 @@ impl Profile { /// /// ```no_run /// use eyre::Result; -/// use iroha_wasm_builder::Builder; +/// use iroha_wasm_builder::{Builder, Profile}; /// /// fn main() -> Result<()> { /// let bytes = Builder::new("relative/path/to/smartcontract/", Profile::Deploy) @@ -223,7 +223,7 @@ mod internal { } fn build_profile(&self) -> String { - return format!("--profile={}", self.profile.clone()); + format!("--profile={}", self.profile.clone()) } fn build_options() -> impl Iterator {