From 15778b21293e18f0195f9877a53c77e15b3d3b47 Mon Sep 17 00:00:00 2001 From: Dmitry Murzin Date: Wed, 30 Oct 2024 16:56:32 +0300 Subject: [PATCH 1/2] fix: Don't use spinner when building wasm on CI (#5208) Signed-off-by: Dmitry Murzin --- crates/iroha_wasm_builder/src/main.rs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/iroha_wasm_builder/src/main.rs b/crates/iroha_wasm_builder/src/main.rs index e5004888ccb..73b35822d49 100644 --- a/crates/iroha_wasm_builder/src/main.rs +++ b/crates/iroha_wasm_builder/src/main.rs @@ -59,20 +59,28 @@ fn main() -> color_eyre::Result<()> { }; let output = if optimize { - let mut sp = spinoff::Spinner::new_with_stream( - spinoff::spinners::Binary, - "Optimizing the output", - None, - spinoff::Streams::Stderr, - ); + let sp = if std::env::var("CI").is_err() { + Some(spinoff::Spinner::new_with_stream( + spinoff::spinners::Binary, + "Optimizing the output", + None, + spinoff::Streams::Stderr, + )) + } else { + None + }; match output.optimize() { Ok(optimized) => { - sp.success("Output is optimized"); + if let Some(mut sp) = sp { + sp.success("Output is optimized"); + } optimized } err => { - sp.fail("Optimization failed"); + if let Some(mut sp) = sp { + sp.fail("Optimization failed"); + } err? } } From bba5fa690012b9628a6041b8ae5a8c435df8e02a Mon Sep 17 00:00:00 2001 From: Dmitry Murzin Date: Wed, 30 Oct 2024 20:39:12 +0300 Subject: [PATCH 2/2] fix: Fix running tests for individual crates (#5210) Signed-off-by: Dmitry Murzin --- Cargo.toml | 2 +- crates/iroha/tests/queries/mod.rs | 4 ++-- crates/iroha_cli/src/main.rs | 6 +++--- crates/iroha_config/Cargo.toml | 6 +++--- crates/iroha_numeric/Cargo.toml | 2 +- crates/iroha_primitives/Cargo.toml | 1 - crates/iroha_schema/Cargo.toml | 2 +- crates/iroha_version/Cargo.toml | 2 +- crates/iroha_version_derive/Cargo.toml | 2 +- crates/iroha_wasm_codec/Cargo.toml | 2 +- 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eeb917bca99..8569c51c1e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,7 +116,7 @@ dashmap = "5.5.3" rustc-hash = "1.1.0" serde = { version = "1.0.204", default-features = false } -serde_json = { version = "1.0.121", default-features = false } +serde_json = { version = "1.0.121", default-features = false, features = ["alloc"] } serde_with = { version = "3.9.0", default-features = false } parity-scale-codec = { version = "3.6.12", default-features = false } json5 = "0.4.1" diff --git a/crates/iroha/tests/queries/mod.rs b/crates/iroha/tests/queries/mod.rs index c2551ff1fe2..5b57fab8e44 100644 --- a/crates/iroha/tests/queries/mod.rs +++ b/crates/iroha/tests/queries/mod.rs @@ -41,9 +41,9 @@ fn find_blocks_reversed() -> eyre::Result<()> { let blocks = client.query(FindBlocks).execute_all()?; assert_eq!(blocks.len(), 2); - assert_eq!(blocks[1].header().prev_block_hash, None); + assert_eq!(blocks[1].header().prev_block_hash(), None); assert_eq!( - blocks[0].header().prev_block_hash, + blocks[0].header().prev_block_hash(), Some(blocks[1].header().hash()) ); diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index 3552960a5d7..e4fe13d190f 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -1260,7 +1260,7 @@ mod multisig { .parse() .unwrap(); let args = MultisigAccountArgs { - account: account.signatory.clone(), + account: account.signatory().clone(), signatories: signatories.into_iter().zip(weights).collect(), quorum, transaction_ttl_ms: transaction_ttl @@ -1377,7 +1377,7 @@ mod multisig { for role_id in multisig_roles { let super_account: AccountId = role_id - .name + .name() .as_ref() .strip_prefix("multisig_signatory_") .unwrap() @@ -1388,7 +1388,7 @@ mod multisig { trace_back_from(super_account, client, context)?; let transactions_registry_id: TriggerId = role_id - .name + .name() .as_ref() .replace("signatory", "transactions") .parse() diff --git a/crates/iroha_config/Cargo.toml b/crates/iroha_config/Cargo.toml index a545f5006f2..24fd39a047f 100644 --- a/crates/iroha_config/Cargo.toml +++ b/crates/iroha_config/Cargo.toml @@ -13,8 +13,8 @@ workspace = true [dependencies] iroha_config_base = { workspace = true } iroha_data_model = { workspace = true } -iroha_primitives = { workspace = true } -iroha_crypto = { workspace = true } +iroha_primitives = { workspace = true, features = ["std"] } +iroha_crypto = { workspace = true, features = ["std"] } error-stack = { workspace = true } tracing = { workspace = true } @@ -23,7 +23,7 @@ url = { workspace = true, features = ["serde"] } serde = { workspace = true, features = ["derive"] } serde_with = { workspace = true } -strum = { workspace = true, features = ["derive"] } +strum = { workspace = true, features = ["derive", "std"] } serde_json = { workspace = true } json5 = { workspace = true } thiserror = { workspace = true } diff --git a/crates/iroha_numeric/Cargo.toml b/crates/iroha_numeric/Cargo.toml index 132afe69a59..c73c4df54a8 100644 --- a/crates/iroha_numeric/Cargo.toml +++ b/crates/iroha_numeric/Cargo.toml @@ -40,4 +40,4 @@ displaydoc = { workspace = true } rust_decimal = { version = "1.35", default-features = false, features = ["serde", "serde-with-str"] } [dev-dependencies] -serde_json = { workspace = true, features = ["alloc"] } +serde_json = { workspace = true } diff --git a/crates/iroha_primitives/Cargo.toml b/crates/iroha_primitives/Cargo.toml index cea4f0efd2c..8111925c9d1 100644 --- a/crates/iroha_primitives/Cargo.toml +++ b/crates/iroha_primitives/Cargo.toml @@ -47,5 +47,4 @@ serde_json = { workspace = true } [dev-dependencies] -serde_json = { workspace = true, features = ["alloc"] } trybuild = { workspace = true } diff --git a/crates/iroha_schema/Cargo.toml b/crates/iroha_schema/Cargo.toml index ebe7518703a..15cc95aec17 100644 --- a/crates/iroha_schema/Cargo.toml +++ b/crates/iroha_schema/Cargo.toml @@ -17,5 +17,5 @@ serde = { workspace = true, features = ["derive", "alloc"] } [dev-dependencies] parity-scale-codec = { workspace = true, default-features = false, features = ["derive", "full"] } -serde_json = { workspace = true, features = ["alloc"] } +serde_json = { workspace = true } impls = { workspace = true } diff --git a/crates/iroha_version/Cargo.toml b/crates/iroha_version/Cargo.toml index dd7d322b94e..64631cbfdf4 100644 --- a/crates/iroha_version/Cargo.toml +++ b/crates/iroha_version/Cargo.toml @@ -28,7 +28,7 @@ iroha_version_derive = { path = "../iroha_version_derive", default-features = fa iroha_macro = { workspace = true } parity-scale-codec = { workspace = true, optional = true, features = ["derive"] } -serde_json = { workspace = true, optional = true, features = ["alloc"] } +serde_json = { workspace = true, optional = true } serde = { workspace = true, optional = true, features = ["derive"] } thiserror = { workspace = true, optional = true } diff --git a/crates/iroha_version_derive/Cargo.toml b/crates/iroha_version_derive/Cargo.toml index 0cb685b23b1..52ab8c0783c 100644 --- a/crates/iroha_version_derive/Cargo.toml +++ b/crates/iroha_version_derive/Cargo.toml @@ -25,7 +25,7 @@ iroha_version = { workspace = true, features = ["scale", "json"] } iroha_macro = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["alloc"] } +serde_json = { workspace = true } serde = { workspace = true, features = ["derive"] } trybuild = { workspace = true } diff --git a/crates/iroha_wasm_codec/Cargo.toml b/crates/iroha_wasm_codec/Cargo.toml index b7bd7054e82..8b97a2eb1f3 100644 --- a/crates/iroha_wasm_codec/Cargo.toml +++ b/crates/iroha_wasm_codec/Cargo.toml @@ -14,4 +14,4 @@ iroha_wasm_codec_derive = { path = "../iroha_wasm_codec_derive" } thiserror = { workspace = true } wasmtime = { workspace = true } -parity-scale-codec = { workspace = true, features = ["derive"] } +parity-scale-codec = { workspace = true, features = ["derive", "std"] }