From 6a6ba01d63aa0ba8c4586bbbcbe60fa0dbe7c279 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:47:47 +0700 Subject: [PATCH] chore: fix small issues --- Cargo.lock | 108 +++-------------------------- crates/build/src/lib.rs | 9 ++- crates/extrinsics/Cargo.toml | 2 +- crates/transcode/src/account_id.rs | 14 ++-- 4 files changed, 20 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46f6a989e..a561e60d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1595,7 +1595,7 @@ dependencies = [ "derivative", "futures", "hex", - "ink 5.1.1", + "ink", "ink_env 5.1.0", "ink_metadata 5.1.0", "itertools 0.12.1", @@ -1644,7 +1644,7 @@ dependencies = [ "escape8259", "hex", "indexmap 2.7.0", - "ink 5.1.0", + "ink", "ink_env 5.1.0", "ink_metadata 5.1.0", "itertools 0.12.1", @@ -3520,11 +3520,11 @@ source = "git+https://github.com/use-ink/ink?branch=cmichi-remove-wasm-default-t dependencies = [ "derive_more 1.0.0", "ink_env 5.1.0", - "ink_macro 5.1.0", + "ink_macro", "ink_metadata 5.1.0", "ink_prelude 5.1.0", "ink_primitives 5.1.0", - "ink_storage 5.1.0", + "ink_storage", "pallet-revive-uapi", "parity-scale-codec", "polkavm-derive 0.18.0", @@ -3533,25 +3533,6 @@ dependencies = [ "staging-xcm 7.0.0", ] -[[package]] -name = "ink" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d7438a13d38fa8f4eebea8d1e7c2931058eafd0336c79f4141d4ed0162a412" -dependencies = [ - "derive_more 1.0.0", - "ink_env 5.1.1", - "ink_macro 5.1.1", - "ink_metadata 5.1.1", - "ink_prelude 5.1.1", - "ink_primitives 5.1.1", - "ink_storage 5.1.1", - "pallet-contracts-uapi", - "parity-scale-codec", - "scale-info", - "staging-xcm 11.0.0", -] - [[package]] name = "ink_allocator" version = "5.1.0" @@ -3579,7 +3560,7 @@ dependencies = [ "either", "heck 0.5.0", "impl-serde 0.5.0", - "ink_ir 5.1.0", + "ink_ir", "ink_primitives 5.1.0", "itertools 0.13.0", "parity-scale-codec", @@ -3591,28 +3572,6 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "ink_codegen" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2238f147295746f1fee4cf7dcdee6378c94e61fbf7b9f9f4bb2a7f918530801b" -dependencies = [ - "blake2", - "derive_more 1.0.0", - "either", - "heck 0.5.0", - "impl-serde 0.4.0", - "ink_ir 5.1.1", - "ink_primitives 5.1.1", - "itertools 0.12.1", - "parity-scale-codec", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 2.0.96", -] - [[package]] name = "ink_engine" version = "5.1.0" @@ -3655,7 +3614,7 @@ dependencies = [ "derive_more 1.0.0", "ink_allocator 5.1.0", "ink_engine 5.1.0", - "ink_macro 5.1.0", + "ink_macro", "ink_prelude 5.1.0", "ink_primitives 5.1.0", "ink_storage_traits 5.1.0", @@ -3722,29 +3681,13 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "ink_ir" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e201688fb27ff97496a4231a393dd4befcc5a9c092d6bf231f0f5d409ef44f34" -dependencies = [ - "blake2", - "either", - "impl-serde 0.4.0", - "ink_prelude 5.1.1", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.96", -] - [[package]] name = "ink_macro" version = "5.1.0" source = "git+https://github.com/use-ink/ink?branch=cmichi-remove-wasm-default-to-revive#8425081a782c4a811180467e007b0ff452530986" dependencies = [ - "ink_codegen 5.1.0", - "ink_ir 5.1.0", + "ink_codegen", + "ink_ir", "ink_primitives 5.1.0", "parity-scale-codec", "proc-macro2", @@ -3753,22 +3696,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "ink_macro" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce9465553d3066a8e28bd94a94880289084c4ff12f1852312553e902fa1ffdd" -dependencies = [ - "ink_codegen 5.1.1", - "ink_ir 5.1.1", - "ink_primitives 5.1.1", - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.96", - "synstructure", -] - [[package]] name = "ink_metadata" version = "5.1.0" @@ -3868,25 +3795,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "ink_storage" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bed602a974481b194084b93957917f27e724c7561fd0de9b6f3c171590c839b" -dependencies = [ - "array-init", - "cfg-if", - "derive_more 1.0.0", - "ink_env 5.1.1", - "ink_metadata 5.1.1", - "ink_prelude 5.1.1", - "ink_primitives 5.1.1", - "ink_storage_traits 5.1.1", - "pallet-contracts-uapi", - "parity-scale-codec", - "scale-info", -] - [[package]] name = "ink_storage_traits" version = "5.1.0" diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index 9ea4ecceb..256aa8fe9 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -223,7 +223,7 @@ impl BuildResult { .to_string() .bold() ); - return out + return out; }; let mut out = format!( @@ -610,7 +610,7 @@ fn check_dylint_requirements(_working_dir: Option<&Path>) -> Result<()> { child } else { tracing::debug!("Error spawning `{:?}`", cmd); - return false + return false; }; child.wait().map(|ret| ret.success()).unwrap_or_else(|err| { @@ -717,7 +717,7 @@ pub fn execute(args: ExecuteArgs) -> Result { // if image exists, then --verifiable was called and we need to build inside docker. if build_mode == &BuildMode::Verifiable { - return docker_build(args) + return docker_build(args); } // The CLI flag `optimization-passes` overwrites optimization passes which are @@ -824,7 +824,6 @@ fn local_build( network, unstable_flags, keep_debug_symbols, - extra_lints, skip_wasm_validation, target, max_memory_pages, @@ -900,7 +899,7 @@ fn local_build( crate_metadata.original_code.display(), pre_fingerprint ); - return Ok((None, build_info, dest_code_path)) + return Ok((None, build_info, dest_code_path)); } verbose_eprintln!( diff --git a/crates/extrinsics/Cargo.toml b/crates/extrinsics/Cargo.toml index 1b547446e..dfe92c148 100644 --- a/crates/extrinsics/Cargo.toml +++ b/crates/extrinsics/Cargo.toml @@ -47,7 +47,7 @@ ink_metadata = { workspace = true } ink_env = { workspace = true } [dev-dependencies] -ink = "5.0.0" +ink = { workspace = true, features = ["unstable"] } assert_cmd = "2.0.14" regex = "1.10.4" predicates = "3.1.0" diff --git a/crates/transcode/src/account_id.rs b/crates/transcode/src/account_id.rs index ce291f5df..4dffa3e06 100644 --- a/crates/transcode/src/account_id.rs +++ b/crates/transcode/src/account_id.rs @@ -122,7 +122,7 @@ impl AccountId32 { use base58::FromBase58; let data = s.from_base58().map_err(|_| FromSs58Error::BadBase58)?; if data.len() < 2 { - return Err(FromSs58Error::BadLength) + return Err(FromSs58Error::BadLength); } let prefix_len = match data[0] { 0..=63 => 1, @@ -130,14 +130,14 @@ impl AccountId32 { _ => return Err(FromSs58Error::InvalidPrefix), }; if data.len() != prefix_len + body_len + CHECKSUM_LEN { - return Err(FromSs58Error::BadLength) + return Err(FromSs58Error::BadLength); } let hash = ss58hash(&data[0..body_len + prefix_len]); let checksum = &hash[0..CHECKSUM_LEN]; if data[body_len + prefix_len..body_len + prefix_len + CHECKSUM_LEN] != *checksum { // Invalid checksum. - return Err(FromSs58Error::InvalidChecksum) + return Err(FromSs58Error::InvalidChecksum); } let result = data[prefix_len..body_len + prefix_len] @@ -212,14 +212,14 @@ mod test { use super::*; use sp_core::crypto::Ss58Codec; - use sp_keyring::AccountKeyring; + use sp_keyring::Sr25519Keyring; #[test] fn ss58_is_compatible_with_substrate_impl() { let keyrings = vec![ - AccountKeyring::Alice, - AccountKeyring::Bob, - AccountKeyring::Charlie, + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, ]; for keyring in keyrings {