From ebb7e2b5583e048bc78c25ec92080eca94cabe85 Mon Sep 17 00:00:00 2001 From: ascjones Date: Wed, 7 Sep 2022 12:19:44 +0100 Subject: [PATCH 01/18] Replace all ink_lang with new ink crate --- Cargo.lock | 185 ++++++++++++++---- crates/cargo-contract/src/crate_metadata.rs | 6 +- .../cargo-contract/templates/new/_Cargo.toml | 12 +- crates/cargo-contract/templates/new/lib.rs | 5 - crates/cargo-contract/tests/decode.rs | 2 - crates/transcode/Cargo.toml | 4 +- crates/transcode/src/lib.rs | 1 - 7 files changed, 157 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7e72c3a7..33dbe341c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -648,11 +648,9 @@ dependencies = [ "escape8259", "hex", "indexmap", - "ink_env", - "ink_lang", - "ink_metadata", - "ink_primitives", - "ink_storage", + "ink", + "ink_env 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_metadata 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools", "nom", "nom-supreme", @@ -1425,6 +1423,19 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "ink" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_lang", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_storage", +] + [[package]] name = "ink_allocator" version = "4.0.0-alpha.1" @@ -1434,6 +1445,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_allocator" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_engine" version = "4.0.0-alpha.1" @@ -1449,6 +1468,20 @@ dependencies = [ "sha3", ] +[[package]] +name = "ink_engine" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "blake2", + "derive_more", + "parity-scale-codec", + "rand 0.8.5", + "secp256k1 0.24.0", + "sha2 0.10.2", + "sha3", +] + [[package]] name = "ink_env" version = "4.0.0-alpha.1" @@ -1459,11 +1492,37 @@ dependencies = [ "blake2", "cfg-if", "derive_more", - "ink_allocator", - "ink_engine", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_allocator 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_engine 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_metadata 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "rlibc", + "scale-info", + "secp256k1 0.24.0", + "sha2 0.10.2", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_env" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "arrayref", + "blake2", + "cfg-if", + "derive_more", + "ink_allocator 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_engine 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "num-traits", "parity-scale-codec", "paste", @@ -1479,15 +1538,14 @@ dependencies = [ [[package]] name = "ink_lang" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30424a655c93946c8e07473acdd5bc584f772a1a86d3d43bf528ceec03f1aa4c" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ "derive_more", - "ink_env", + "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "ink_lang_macro", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "ink_storage", "parity-scale-codec", ] @@ -1495,15 +1553,15 @@ dependencies = [ [[package]] name = "ink_lang_codegen" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7e0d02c594736048253a0784fd78316a93e186881317aa65b53a7a23c7f750" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ "blake2", "derive_more", "either", "heck", - "impl-serde 0.3.2", + "impl-serde 0.4.0", "ink_lang_ir", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "itertools", "parity-scale-codec", "proc-macro2", @@ -1514,11 +1572,11 @@ dependencies = [ [[package]] name = "ink_lang_ir" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab84043bbde9fd0ab685e5f32be92c5223b943a1a30078f1ceae19386df2d32" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ "blake2", "either", + "ink_storage_codegen", "itertools", "proc-macro2", "quote", @@ -1528,12 +1586,11 @@ dependencies = [ [[package]] name = "ink_lang_macro" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63f2bc42f196e8397ec4c87763a4998b0c3ef605a4067e5b7a743812bab9864" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ "ink_lang_codegen", "ink_lang_ir", - "ink_primitives", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "parity-scale-codec", "proc-macro2", "syn", @@ -1547,8 +1604,21 @@ checksum = "a0cf9e970d05710b5488ad92c19b9ab94fc6ece973db4f4c8e1e0d2ff59218cf" dependencies = [ "derive_more", "impl-serde 0.3.2", - "ink_prelude", - "ink_primitives", + "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scale-info", + "serde", +] + +[[package]] +name = "ink_metadata" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "derive_more", + "impl-serde 0.4.0", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "scale-info", "serde", ] @@ -1562,6 +1632,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_prelude" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_primitives" version = "4.0.0-alpha.1" @@ -1569,35 +1647,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a601c52715f3f30eaec72958dddebcf60258e3a4c163719c00258153debe515a" dependencies = [ "cfg-if", - "ink_prelude", + "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_primitives" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives_derive", "parity-scale-codec", "scale-info", + "sha2-const", +] + +[[package]] +name = "ink_primitives_derive" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] name = "ink_storage" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5208bd825a580c5e20e3c6befa001aa2b5e179cd548163baa1e6bac2ab4cb4" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ "array-init", "cfg-if", "derive_more", - "ink_env", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", "ink_storage_derive", "parity-scale-codec", "scale-info", ] +[[package]] +name = "ink_storage_codegen" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +dependencies = [ + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "syn", +] + [[package]] name = "ink_storage_derive" version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8eb0065ceb70ed1a2afe8e5dc42ad97df9cdd09072aef944ff580ba7768c959" +source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" dependencies = [ + "ink_storage_codegen", "proc-macro2", "quote", "syn", @@ -2889,6 +2998,12 @@ dependencies = [ "digest 0.10.3", ] +[[package]] +name = "sha2-const" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5edcd790916d95ff81bdc1505b09c74d30d47a755929cc8c71c59cbbfa99f91b" + [[package]] name = "sha3" version = "0.10.1" diff --git a/crates/cargo-contract/src/crate_metadata.rs b/crates/cargo-contract/src/crate_metadata.rs index 1c7d98b09..12f10caad 100644 --- a/crates/cargo-contract/src/crate_metadata.rs +++ b/crates/cargo-contract/src/crate_metadata.rs @@ -100,16 +100,16 @@ impl CrateMetadata { .packages .iter() .find_map(|package| { - if package.name == "ink_lang" { + if package.name == "ink" { Some( Version::parse(&package.version.to_string()) - .expect("Invalid ink_lang version string"), + .expect("Invalid ink crate version string"), ) } else { None } }) - .ok_or_else(|| anyhow::anyhow!("No 'ink_lang' dependency found"))?; + .ok_or_else(|| anyhow::anyhow!("No 'ink' dependency found"))?; let ExtraMetadata { documentation, diff --git a/crates/cargo-contract/templates/new/_Cargo.toml b/crates/cargo-contract/templates/new/_Cargo.toml index e63990243..ed3813adb 100644 --- a/crates/cargo-contract/templates/new/_Cargo.toml +++ b/crates/cargo-contract/templates/new/_Cargo.toml @@ -5,11 +5,8 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -ink_primitives = { version = "4.0.0-alpha.1", default-features = false } -ink_metadata = { version = "4.0.0-alpha.1", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "4.0.0-alpha.1", default-features = false } -ink_storage = { version = "4.0.0-alpha.1", default-features = false } -ink_lang = { version = "4.0.0-alpha.1", default-features = false } +# todo: update to crates.io version once released +ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "aj/ink_crate" } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } @@ -25,10 +22,7 @@ crate-type = [ [features] default = ["std"] std = [ - "ink_metadata/std", - "ink_env/std", - "ink_storage/std", - "ink_primitives/std", + "ink/std", "scale/std", "scale-info/std", ] diff --git a/crates/cargo-contract/templates/new/lib.rs b/crates/cargo-contract/templates/new/lib.rs index 45c4c5edd..6fd410c4f 100644 --- a/crates/cargo-contract/templates/new/lib.rs +++ b/crates/cargo-contract/templates/new/lib.rs @@ -1,7 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -use ink_lang as ink; - #[ink::contract] mod {{name}} { @@ -52,9 +50,6 @@ mod {{name}} { /// Imports all the definitions from the outer scope so we can use them here. use super::*; - /// Imports `ink_lang` so we can use `#[ink::test]`. - use ink_lang as ink; - /// We test if the default constructor does its job. #[ink::test] fn default_works() { diff --git a/crates/cargo-contract/tests/decode.rs b/crates/cargo-contract/tests/decode.rs index f04e81dc7..848da7b8f 100644 --- a/crates/cargo-contract/tests/decode.rs +++ b/crates/cargo-contract/tests/decode.rs @@ -29,8 +29,6 @@ fn decode_works() { let contract = r#" #![cfg_attr(not(feature = "std"), no_std)] - use ink_lang as ink; - #[ink::contract] mod switcher { #[ink(event)] diff --git a/crates/transcode/Cargo.toml b/crates/transcode/Cargo.toml index e1dc6a22c..2b3e71d4a 100644 --- a/crates/transcode/Cargo.toml +++ b/crates/transcode/Cargo.toml @@ -38,9 +38,7 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink_lang = "4.0.0-alpha.1" -ink_primitives = "4.0.0-alpha.1" -ink_storage = "4.0.0-alpha.1" +ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "aj/ink_crate" } [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata diff --git a/crates/transcode/src/lib.rs b/crates/transcode/src/lib.rs index faa0b6a97..06a1b4ace 100644 --- a/crates/transcode/src/lib.rs +++ b/crates/transcode/src/lib.rs @@ -403,7 +403,6 @@ mod tests { use std::str::FromStr; use crate::scon::Hex; - use ink_lang as ink; #[allow(clippy::extra_unused_lifetimes)] #[ink::contract] From 95d744be06c5c2d6bc9f51a02b53b8846531d45e Mon Sep 17 00:00:00 2001 From: ascjones Date: Wed, 7 Sep 2022 12:32:56 +0100 Subject: [PATCH 02/18] Fix ink_metadata imports --- crates/cargo-contract/src/workspace/manifest.rs | 10 +++++----- crates/cargo-contract/src/workspace/metadata.rs | 10 +++++----- .../templates/tools/generate-metadata/main.rs | 2 +- crates/transcode/src/lib.rs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/cargo-contract/src/workspace/manifest.rs b/crates/cargo-contract/src/workspace/manifest.rs index 89bece23f..e6224c3c9 100644 --- a/crates/cargo-contract/src/workspace/manifest.rs +++ b/crates/cargo-contract/src/workspace/manifest.rs @@ -462,18 +462,18 @@ impl Manifest { .as_str() .ok_or_else(|| anyhow::anyhow!("[package] name should be a string"))?; - let ink_metadata = self + let ink_crate = self .toml .get("dependencies") .ok_or_else(|| anyhow::anyhow!("[dependencies] section not found"))? - .get("ink_metadata") - .ok_or_else(|| anyhow::anyhow!("ink_metadata dependency not found"))? + .get("ink") + .ok_or_else(|| anyhow::anyhow!("ink dependency not found"))? .as_table() .ok_or_else(|| { - anyhow::anyhow!("ink_metadata dependency should be a table") + anyhow::anyhow!("ink dependency should be a table") })?; - metadata::generate_package(dir, contract_package_name, ink_metadata.clone())?; + metadata::generate_package(dir, contract_package_name, ink_crate.clone())?; } let updated_toml = toml::to_string(&self.toml)?; diff --git a/crates/cargo-contract/src/workspace/metadata.rs b/crates/cargo-contract/src/workspace/metadata.rs index 2919b5d5b..bb97ada80 100644 --- a/crates/cargo-contract/src/workspace/metadata.rs +++ b/crates/cargo-contract/src/workspace/metadata.rs @@ -31,7 +31,7 @@ use toml::value; pub(super) fn generate_package>( target_dir: P, contract_package_name: &str, - mut ink_metadata_dependency: value::Table, + mut ink_crate_dependency: value::Table, ) -> Result<()> { let dir = target_dir.as_ref(); tracing::debug!( @@ -59,12 +59,12 @@ pub(super) fn generate_package>( contract.insert("package".into(), contract_package_name.into()); // make ink_metadata dependency use default features - ink_metadata_dependency.remove("default-features"); - ink_metadata_dependency.remove("features"); - ink_metadata_dependency.remove("optional"); + ink_crate_dependency.remove("default-features"); + ink_crate_dependency.remove("features"); + ink_crate_dependency.remove("optional"); // add ink dependencies copied from contract manifest - deps.insert("ink_metadata".into(), ink_metadata_dependency.into()); + deps.insert("ink".into(), ink_crate_dependency.into()); let cargo_toml = toml::to_string(&cargo_toml)?; fs::write(dir.join("Cargo.toml"), cargo_toml)?; diff --git a/crates/cargo-contract/templates/tools/generate-metadata/main.rs b/crates/cargo-contract/templates/tools/generate-metadata/main.rs index c703267b4..e675b457e 100644 --- a/crates/cargo-contract/templates/tools/generate-metadata/main.rs +++ b/crates/cargo-contract/templates/tools/generate-metadata/main.rs @@ -3,7 +3,7 @@ extern crate contract; extern "Rust" { // Note: The ink! metdata codegen generates an implementation for this function, // which is what we end up linking to here. - fn __ink_generate_metadata() -> ink_metadata::InkProject; + fn __ink_generate_metadata() -> ink::metadata::InkProject; } fn main() -> Result<(), std::io::Error> { diff --git a/crates/transcode/src/lib.rs b/crates/transcode/src/lib.rs index 06a1b4ace..22d9d92fe 100644 --- a/crates/transcode/src/lib.rs +++ b/crates/transcode/src/lib.rs @@ -474,9 +474,9 @@ mod tests { } } - fn generate_metadata() -> ink_metadata::InkProject { + fn generate_metadata() -> ink::metadata::InkProject { extern "Rust" { - fn __ink_generate_metadata() -> ink_metadata::InkProject; + fn __ink_generate_metadata() -> ink::metadata::InkProject; } unsafe { __ink_generate_metadata() } From bc0043f4a64a37fb9fbbd514e6adda71aa72efc6 Mon Sep 17 00:00:00 2001 From: ascjones Date: Wed, 7 Sep 2022 12:33:11 +0100 Subject: [PATCH 03/18] Fmt --- crates/cargo-contract/src/workspace/manifest.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/cargo-contract/src/workspace/manifest.rs b/crates/cargo-contract/src/workspace/manifest.rs index e6224c3c9..f68e06865 100644 --- a/crates/cargo-contract/src/workspace/manifest.rs +++ b/crates/cargo-contract/src/workspace/manifest.rs @@ -469,9 +469,7 @@ impl Manifest { .get("ink") .ok_or_else(|| anyhow::anyhow!("ink dependency not found"))? .as_table() - .ok_or_else(|| { - anyhow::anyhow!("ink dependency should be a table") - })?; + .ok_or_else(|| anyhow::anyhow!("ink dependency should be a table"))?; metadata::generate_package(dir, contract_package_name, ink_crate.clone())?; } From f9a65f1b5c88c10383becc055a1f46f6bc2b8019 Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 13:21:34 +0100 Subject: [PATCH 04/18] Change ink-debug feature to use entrance crate --- crates/cargo-contract/src/cmd/build/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-contract/src/cmd/build/mod.rs b/crates/cargo-contract/src/cmd/build/mod.rs index f2499360a..76501a39f 100644 --- a/crates/cargo-contract/src/cmd/build/mod.rs +++ b/crates/cargo-contract/src/cmd/build/mod.rs @@ -295,7 +295,7 @@ fn exec_cargo_for_wasm_target( args.push("--offline"); } if build_mode == BuildMode::Debug { - args.push("--features=ink_env/ink-debug"); + args.push("--features=ink/ink-debug"); } else { args.push("-Zbuild-std-features=panic_immediate_abort"); } From d7fae81fc213a292f3835a9e2e5b6801e26d2ff7 Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 17:12:44 +0100 Subject: [PATCH 05/18] Use master branc of ink in new template --- crates/cargo-contract/templates/new/_Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-contract/templates/new/_Cargo.toml b/crates/cargo-contract/templates/new/_Cargo.toml index ed3813adb..e0128ebda 100644 --- a/crates/cargo-contract/templates/new/_Cargo.toml +++ b/crates/cargo-contract/templates/new/_Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] # todo: update to crates.io version once released -ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "aj/ink_crate" } +ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master" } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } From ad0bb4be768653db1a9ee04b0565de3647d170c1 Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 17:34:51 +0100 Subject: [PATCH 06/18] Update to master ink --- crates/transcode/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/transcode/Cargo.toml b/crates/transcode/Cargo.toml index d999ac686..a42d59723 100644 --- a/crates/transcode/Cargo.toml +++ b/crates/transcode/Cargo.toml @@ -38,7 +38,7 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "aj/ink_crate" } +ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master" } [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata From 10abd2c97b981508f3a69139de40130c9f8dd7db Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 17:44:08 +0100 Subject: [PATCH 07/18] Set RUSTC_BOOTSTRAP --- .github/workflows/ci.yml | 3 + Cargo.lock | 156 +++++++++++++++++++-------------------- 2 files changed, 77 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6786df6e7..7e171b795 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,8 @@ jobs: clippy: runs-on: ubuntu-latest + env: + RUSTC_BOOTSTRAP: 1 steps: - name: Install toolchain uses: actions-rs/toolchain@v1 @@ -67,6 +69,7 @@ jobs: os: ["ubuntu-22.04", "macos-12", "windows-2022"] runs-on: ${{ matrix.os }} env: + RUSTC_BOOTSTRAP: 1 RUST_BACKTRACE: full steps: - name: Checkout diff --git a/Cargo.lock b/Cargo.lock index 95a4d341b..b4aa9e490 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1424,14 +1424,16 @@ dependencies = [ [[package]] name = "ink" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ - "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_lang", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "derive_more", + "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_macro", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "ink_storage", + "parity-scale-codec", ] [[package]] @@ -1446,11 +1448,30 @@ dependencies = [ [[package]] name = "ink_allocator" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "cfg-if", ] +[[package]] +name = "ink_codegen" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +dependencies = [ + "blake2", + "derive_more", + "either", + "heck", + "impl-serde 0.4.0", + "ink_ir", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "itertools", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "ink_engine" version = "4.0.0-alpha.1" @@ -1469,10 +1490,11 @@ dependencies = [ [[package]] name = "ink_engine" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "blake2", "derive_more", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "parity-scale-codec", "rand 0.8.5", "secp256k1 0.24.0", @@ -1510,17 +1532,18 @@ dependencies = [ [[package]] name = "ink_env" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "arrayref", "blake2", "cfg-if", "derive_more", - "ink_allocator 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_engine 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_allocator 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_engine 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_storage_traits", "num-traits", "parity-scale-codec", "paste", @@ -1534,43 +1557,9 @@ dependencies = [ ] [[package]] -name = "ink_lang" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" -dependencies = [ - "derive_more", - "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_lang_macro", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_storage", - "parity-scale-codec", -] - -[[package]] -name = "ink_lang_codegen" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" -dependencies = [ - "blake2", - "derive_more", - "either", - "heck", - "impl-serde 0.4.0", - "ink_lang_ir", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "itertools", - "parity-scale-codec", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ink_lang_ir" +name = "ink_ir" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "blake2", "either", @@ -1582,13 +1571,13 @@ dependencies = [ ] [[package]] -name = "ink_lang_macro" +name = "ink_macro" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ - "ink_lang_codegen", - "ink_lang_ir", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_codegen", + "ink_ir", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "parity-scale-codec", "proc-macro2", "syn", @@ -1611,12 +1600,12 @@ dependencies = [ [[package]] name = "ink_metadata" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "derive_more", "impl-serde 0.4.0", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "scale-info", "serde", ] @@ -1633,7 +1622,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "cfg-if", ] @@ -1653,39 +1642,28 @@ dependencies = [ [[package]] name = "ink_primitives" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives_derive", + "derive_more", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "parity-scale-codec", "scale-info", "sha2-const", ] -[[package]] -name = "ink_primitives_derive" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "ink_storage" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "array-init", "cfg-if", "derive_more", - "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", - "ink_storage_derive", + "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_storage_traits", "parity-scale-codec", "scale-info", ] @@ -1693,16 +1671,16 @@ dependencies = [ [[package]] name = "ink_storage_codegen" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=aj/ink_crate)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "syn", ] [[package]] name = "ink_storage_derive" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=aj/ink_crate#4ecf5519ae07a516e83d74a215f0de55b6ee56d5" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" dependencies = [ "ink_storage_codegen", "proc-macro2", @@ -1711,6 +1689,20 @@ dependencies = [ "synstructure", ] +[[package]] +name = "ink_storage_traits" +version = "4.0.0-alpha.1" +source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +dependencies = [ + "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_storage_derive", + "parity-scale-codec", + "scale-info", + "syn", +] + [[package]] name = "instant" version = "0.1.12" From bb169d24c64a15e98e69f1db0d783d205f98f9c5 Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 17:56:15 +0100 Subject: [PATCH 08/18] Fix tests --- crates/transcode/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/transcode/src/lib.rs b/crates/transcode/src/lib.rs index 22d9d92fe..b0b9626c2 100644 --- a/crates/transcode/src/lib.rs +++ b/crates/transcode/src/lib.rs @@ -474,9 +474,9 @@ mod tests { } } - fn generate_metadata() -> ink::metadata::InkProject { + fn generate_metadata() -> InkProject { extern "Rust" { - fn __ink_generate_metadata() -> ink::metadata::InkProject; + fn __ink_generate_metadata() -> InkProject; } unsafe { __ink_generate_metadata() } From 2e9c305135efc92976c37e93e7c45285d7707727 Mon Sep 17 00:00:00 2001 From: ascjones Date: Thu, 15 Sep 2022 17:58:12 +0100 Subject: [PATCH 09/18] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ce54ba7..e66171096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - `--output-json` support for `call`, `instantiate` and `upload` commands - [#722](https://github.com/paritytech/cargo-contract/pull/722) +- Use new ink entrance crate - [#728](https://github.com/paritytech/cargo-contract/pull/728) ## [2.0.0-alpha.2] - 2022-09-02 From 6b28ccb02e88cfb29646c4099373348677224838 Mon Sep 17 00:00:00 2001 From: ascjones Date: Fri, 16 Sep 2022 10:39:03 +0100 Subject: [PATCH 10/18] Set RUSTC_BOOTSTRAP because we depend on ink! --- .cargo/config.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..b677b9b2a --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,4 @@ +[env] +# We need to enable `RUSTC_BOOTSTRAP` so that the nightly ink! +# features still work on stable. +RUSTC_BOOTSTRAP = "1" \ No newline at end of file From 8abef6550f36403d950e8b918b85a71d5f46114a Mon Sep 17 00:00:00 2001 From: ascjones Date: Fri, 16 Sep 2022 11:26:06 +0100 Subject: [PATCH 11/18] Set default-features = false for ink dep --- crates/cargo-contract/templates/new/_Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-contract/templates/new/_Cargo.toml b/crates/cargo-contract/templates/new/_Cargo.toml index e0128ebda..054015c8d 100644 --- a/crates/cargo-contract/templates/new/_Cargo.toml +++ b/crates/cargo-contract/templates/new/_Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] # todo: update to crates.io version once released -ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master" } +ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } From c63e13bd488d505f894e9013ad28a6fd4206c8d5 Mon Sep 17 00:00:00 2001 From: ascjones Date: Fri, 16 Sep 2022 11:35:01 +0100 Subject: [PATCH 12/18] Set RUSTC_BOOTSTRAP in cargo config file --- .cargo/config.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index b677b9b2a..9f3da921c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,4 @@ [env] -# We need to enable `RUSTC_BOOTSTRAP` so that the nightly ink! -# features still work on stable. -RUSTC_BOOTSTRAP = "1" \ No newline at end of file +# We need to enable `RUSTC_BOOTSTRAP` because of dependencies on ink! crates +# which require nightly features +#RUSTC_BOOTSTRAP = "1" \ No newline at end of file From 9b59b0ae2e4d6ececc167a9f2a63b115ebfb1c4b Mon Sep 17 00:00:00 2001 From: ascjones Date: Fri, 16 Sep 2022 11:35:34 +0100 Subject: [PATCH 13/18] Reenable RUSTC_BOOTSTRAP --- .cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 9f3da921c..acd1a7566 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,4 @@ [env] # We need to enable `RUSTC_BOOTSTRAP` because of dependencies on ink! crates # which require nightly features -#RUSTC_BOOTSTRAP = "1" \ No newline at end of file +RUSTC_BOOTSTRAP = "1" \ No newline at end of file From 725ed68d712275e4d433e4dcb813e8b556ede1ee Mon Sep 17 00:00:00 2001 From: ascjones Date: Fri, 16 Sep 2022 11:36:14 +0100 Subject: [PATCH 14/18] Don't need RUSTC_BOOTSTRAP in CI script now --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e171b795..6786df6e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,6 @@ jobs: clippy: runs-on: ubuntu-latest - env: - RUSTC_BOOTSTRAP: 1 steps: - name: Install toolchain uses: actions-rs/toolchain@v1 @@ -69,7 +67,6 @@ jobs: os: ["ubuntu-22.04", "macos-12", "windows-2022"] runs-on: ${{ matrix.os }} env: - RUSTC_BOOTSTRAP: 1 RUST_BACKTRACE: full steps: - name: Checkout From 551d04a1169a9887bdbe052af6bf46aa850a4057 Mon Sep 17 00:00:00 2001 From: ascjones Date: Tue, 20 Sep 2022 11:24:02 +0100 Subject: [PATCH 15/18] Remove config with RUSTC_BOOTSTRAP, update ink --- .cargo/config.toml | 4 ---- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 2 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index acd1a7566..000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,4 +0,0 @@ -[env] -# We need to enable `RUSTC_BOOTSTRAP` because of dependencies on ink! crates -# which require nightly features -RUSTC_BOOTSTRAP = "1" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 33cbd455b..a809b8c43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1424,7 +1424,7 @@ dependencies = [ [[package]] name = "ink" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "derive_more", "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", @@ -1448,7 +1448,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "cfg-if", ] @@ -1456,7 +1456,7 @@ dependencies = [ [[package]] name = "ink_codegen" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "blake2", "derive_more", @@ -1490,7 +1490,7 @@ dependencies = [ [[package]] name = "ink_engine" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "blake2", "derive_more", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "ink_env" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "arrayref", "blake2", @@ -1559,7 +1559,7 @@ dependencies = [ [[package]] name = "ink_ir" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "blake2", "either", @@ -1573,7 +1573,7 @@ dependencies = [ [[package]] name = "ink_macro" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "ink_codegen", "ink_ir", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "derive_more", "impl-serde 0.4.0", @@ -1622,7 +1622,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "cfg-if", ] @@ -1642,19 +1642,19 @@ dependencies = [ [[package]] name = "ink_primitives" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "derive_more", "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "parity-scale-codec", "scale-info", - "sha2-const", + "xxhash-rust", ] [[package]] name = "ink_storage" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "array-init", "cfg-if", @@ -1671,7 +1671,7 @@ dependencies = [ [[package]] name = "ink_storage_codegen" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "syn", @@ -1680,7 +1680,7 @@ dependencies = [ [[package]] name = "ink_storage_derive" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "ink_storage_codegen", "proc-macro2", @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "ink_storage_traits" version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#3eb6eb06db97de1d418b62816fd6c97a973aa82b" +source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", @@ -2982,12 +2982,6 @@ dependencies = [ "digest 0.10.3", ] -[[package]] -name = "sha2-const" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5edcd790916d95ff81bdc1505b09c74d30d47a755929cc8c71c59cbbfa99f91b" - [[package]] name = "sha3" version = "0.10.1" @@ -3829,7 +3823,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] @@ -4207,6 +4201,12 @@ dependencies = [ "tap", ] +[[package]] +name = "xxhash-rust" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074914ea4eec286eb8d1fd745768504f420a1f7b7919185682a4a267bed7d2e7" + [[package]] name = "yansi" version = "0.5.1" From c2f9ca4f9595159f4fcc68705dbb21d13f67c404 Mon Sep 17 00:00:00 2001 From: ascjones Date: Tue, 20 Sep 2022 16:08:21 +0100 Subject: [PATCH 16/18] Debug format error message to show reason --- crates/cargo-contract/src/cmd/extrinsics/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-contract/src/cmd/extrinsics/error.rs b/crates/cargo-contract/src/cmd/extrinsics/error.rs index a42f23093..7c7266d30 100644 --- a/crates/cargo-contract/src/cmd/extrinsics/error.rs +++ b/crates/cargo-contract/src/cmd/extrinsics/error.rs @@ -42,7 +42,7 @@ impl From for ErrorVariant { impl From for ErrorVariant { fn from(error: anyhow::Error) -> Self { - Self::Generic(GenericError::from_message(format!("{}", error))) + Self::Generic(GenericError::from_message(format!("{:?}", error))) } } From f8e2580172abc077fab0bbf2777df9afa3ce9a4e Mon Sep 17 00:00:00 2001 From: ascjones Date: Tue, 20 Sep 2022 16:39:10 +0100 Subject: [PATCH 17/18] Use github versions of ink deps --- Cargo.lock | 136 +++++++----------------------------- crates/transcode/Cargo.toml | 6 +- 2 files changed, 29 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a809b8c43..a004ed029 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -649,8 +649,8 @@ dependencies = [ "hex", "indexmap", "ink", - "ink_env 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_metadata 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_env", + "ink_metadata", "itertools", "nom", "nom-supreme", @@ -1427,24 +1427,15 @@ version = "4.0.0-alpha.1" source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "derive_more", - "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_env", "ink_macro", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_metadata", + "ink_prelude", + "ink_primitives", "ink_storage", "parity-scale-codec", ] -[[package]] -name = "ink_allocator" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51716586362dbfbaf67cdfd1d2e683b7925daf69a437a6fe16ff20583129d7c4" -dependencies = [ - "cfg-if", -] - [[package]] name = "ink_allocator" version = "4.0.0-alpha.1" @@ -1464,7 +1455,7 @@ dependencies = [ "heck", "impl-serde 0.4.0", "ink_ir", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives", "itertools", "parity-scale-codec", "proc-macro2", @@ -1472,21 +1463,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ink_engine" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eece522b2a9d73ae66b28b1ce34a27c2169b8fa35bc0f8f97995f6b9a2387dca" -dependencies = [ - "blake2", - "derive_more", - "parity-scale-codec", - "rand 0.8.5", - "secp256k1 0.24.0", - "sha2 0.10.2", - "sha3", -] - [[package]] name = "ink_engine" version = "4.0.0-alpha.1" @@ -1494,39 +1470,12 @@ source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e dependencies = [ "blake2", "derive_more", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "parity-scale-codec", - "rand 0.8.5", - "secp256k1 0.24.0", - "sha2 0.10.2", - "sha3", -] - -[[package]] -name = "ink_env" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0fb4e9e5bdc53e6a49f1716d8d89d25b2f4e3bad6f280773fb976ca77a60ff" -dependencies = [ - "arrayref", - "blake2", - "cfg-if", - "derive_more", - "ink_allocator 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_engine 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_metadata 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_primitives 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits", + "ink_primitives", "parity-scale-codec", - "paste", "rand 0.8.5", - "rlibc", - "scale-info", "secp256k1 0.24.0", "sha2 0.10.2", "sha3", - "static_assertions", ] [[package]] @@ -1538,11 +1487,11 @@ dependencies = [ "blake2", "cfg-if", "derive_more", - "ink_allocator 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_engine 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_allocator", + "ink_engine", + "ink_metadata", + "ink_prelude", + "ink_primitives", "ink_storage_traits", "num-traits", "parity-scale-codec", @@ -1577,26 +1526,12 @@ source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e dependencies = [ "ink_codegen", "ink_ir", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives", "parity-scale-codec", "proc-macro2", "syn", ] -[[package]] -name = "ink_metadata" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0cf9e970d05710b5488ad92c19b9ab94fc6ece973db4f4c8e1e0d2ff59218cf" -dependencies = [ - "derive_more", - "impl-serde 0.3.2", - "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_primitives 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scale-info", - "serde", -] - [[package]] name = "ink_metadata" version = "4.0.0-alpha.1" @@ -1604,21 +1539,12 @@ source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e dependencies = [ "derive_more", "impl-serde 0.4.0", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude", + "ink_primitives", "scale-info", "serde", ] -[[package]] -name = "ink_prelude" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799f1435d7323a130e13ba599ab801b826e4ea90508c04306cf16615a4f88bba" -dependencies = [ - "cfg-if", -] - [[package]] name = "ink_prelude" version = "4.0.0-alpha.1" @@ -1627,25 +1553,13 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "ink_primitives" -version = "4.0.0-alpha.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a601c52715f3f30eaec72958dddebcf60258e3a4c163719c00258153debe515a" -dependencies = [ - "cfg-if", - "ink_prelude 4.0.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec", - "scale-info", -] - [[package]] name = "ink_primitives" version = "4.0.0-alpha.1" source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ "derive_more", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_prelude", "parity-scale-codec", "scale-info", "xxhash-rust", @@ -1659,10 +1573,10 @@ dependencies = [ "array-init", "cfg-if", "derive_more", - "ink_env 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_env", + "ink_metadata", + "ink_prelude", + "ink_primitives", "ink_storage_traits", "parity-scale-codec", "scale-info", @@ -1673,7 +1587,7 @@ name = "ink_storage_codegen" version = "4.0.0-alpha.1" source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_primitives", "syn", ] @@ -1694,9 +1608,9 @@ name = "ink_storage_traits" version = "4.0.0-alpha.1" source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" dependencies = [ - "ink_metadata 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_prelude 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", - "ink_primitives 4.0.0-alpha.1 (git+https://github.com/paritytech/ink?branch=master)", + "ink_metadata", + "ink_prelude", + "ink_primitives", "ink_storage_derive", "parity-scale-codec", "scale-info", diff --git a/crates/transcode/Cargo.toml b/crates/transcode/Cargo.toml index d7fcc6d34..65a71e123 100644 --- a/crates/transcode/Cargo.toml +++ b/crates/transcode/Cargo.toml @@ -23,8 +23,9 @@ env_logger = "0.9.1" escape8259 = "0.5.2" hex = "0.4.3" indexmap = "1.9.1" -ink_env = "4.0.0-alpha.1" -ink_metadata = { version = "4.0.0-alpha.1", features = ["derive"] } +# todo: update to crates.io version once released +ink_env = { package = "ink_env", git = "https://github.com/paritytech/ink", branch = "master" } +ink_metadata = { package = "ink_metadata", git = "https://github.com/paritytech/ink", branch = "master", features = ["derive"] } itertools = "0.10.4" tracing = "0.1.36" nom = "7.1.1" @@ -38,6 +39,7 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" +# todo: update to crates.io version once released ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master" } [features] From f1917f72e81b30414374014e29efe48221b29005 Mon Sep 17 00:00:00 2001 From: ascjones Date: Wed, 21 Sep 2022 13:18:55 +0100 Subject: [PATCH 18/18] Use latest ink release --- Cargo.lock | 87 +++++++++---------- .../cargo-contract/templates/new/_Cargo.toml | 3 +- crates/transcode/Cargo.toml | 8 +- 3 files changed, 43 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a004ed029..47b365166 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1423,8 +1423,9 @@ dependencies = [ [[package]] name = "ink" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfc1a216f815f0da881250d7bff100f821d64a2e7ce08b6eccf01c32fbe95d5" dependencies = [ "derive_more", "ink_env", @@ -1438,16 +1439,18 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d19e055fdd9ef9fa0dd930d706b4b6f546487d3fcc9d45f6ba08d9d0d7102f3" dependencies = [ "cfg-if", ] [[package]] name = "ink_codegen" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a504663904857ce2ba5e8b85fb5d8001ebff40c327f4cc06b10c2f9b403e0a99" dependencies = [ "blake2", "derive_more", @@ -1465,8 +1468,9 @@ dependencies = [ [[package]] name = "ink_engine" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d732c7fef97ab91625125750c73477f0e43cb89b57e57fca4741707c2769871" dependencies = [ "blake2", "derive_more", @@ -1480,8 +1484,9 @@ dependencies = [ [[package]] name = "ink_env" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af306608913616b0b69a8293ce03423f057e3293648909ba66061f38e5794f79" dependencies = [ "arrayref", "blake2", @@ -1507,12 +1512,12 @@ dependencies = [ [[package]] name = "ink_ir" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900a7742a319a1fee36172869397e1f6fdf60adbb6a723cd819f0a1874775056" dependencies = [ "blake2", "either", - "ink_storage_codegen", "itertools", "proc-macro2", "quote", @@ -1521,21 +1526,25 @@ dependencies = [ [[package]] name = "ink_macro" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbaaeaa0e16d757eb799c732737fae6d7261e8a9257d5678b75b92a4f8dc516" dependencies = [ "ink_codegen", "ink_ir", "ink_primitives", "parity-scale-codec", "proc-macro2", + "quote", "syn", + "synstructure", ] [[package]] name = "ink_metadata" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ae8287f3ae7a9473f1b767db3da834b6875ec7ac4c105ee360a38a5b9d9538" dependencies = [ "derive_more", "impl-serde 0.4.0", @@ -1547,16 +1556,18 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd0137ab1536069c7ece025498bc957b02dcaa51460dd2a4402e80521124d04" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433de1b6ff673158ec18b18fc1c149f6e3fa17d76f830256a67292f6fb4bbccf" dependencies = [ "derive_more", "ink_prelude", @@ -1567,8 +1578,9 @@ dependencies = [ [[package]] name = "ink_storage" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573363ad95f7dc14c41ed3109ab856419ba02f8c433ae6ca5f1d227494260f6a" dependencies = [ "array-init", "cfg-if", @@ -1582,36 +1594,15 @@ dependencies = [ "scale-info", ] -[[package]] -name = "ink_storage_codegen" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" -dependencies = [ - "ink_primitives", - "syn", -] - -[[package]] -name = "ink_storage_derive" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" -dependencies = [ - "ink_storage_codegen", - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "ink_storage_traits" -version = "4.0.0-alpha.1" -source = "git+https://github.com/paritytech/ink?branch=master#74b2248f249a963d9e2f039a939a97b5e15e519e" +version = "4.0.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88aa73c6b8815726674ddc451afa23ec363bc0cafaef81f031e036ff3dfa9506" dependencies = [ "ink_metadata", "ink_prelude", "ink_primitives", - "ink_storage_derive", "parity-scale-codec", "scale-info", "syn", @@ -3737,7 +3728,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.7.3", + "rand 0.8.5", "static_assertions", ] diff --git a/crates/cargo-contract/templates/new/_Cargo.toml b/crates/cargo-contract/templates/new/_Cargo.toml index 054015c8d..31b35079d 100644 --- a/crates/cargo-contract/templates/new/_Cargo.toml +++ b/crates/cargo-contract/templates/new/_Cargo.toml @@ -5,8 +5,7 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -# todo: update to crates.io version once released -ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master", default-features = false } +ink = { version = "4.0.0-alpha.3", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/crates/transcode/Cargo.toml b/crates/transcode/Cargo.toml index 65a71e123..ef3b3ad29 100644 --- a/crates/transcode/Cargo.toml +++ b/crates/transcode/Cargo.toml @@ -23,9 +23,8 @@ env_logger = "0.9.1" escape8259 = "0.5.2" hex = "0.4.3" indexmap = "1.9.1" -# todo: update to crates.io version once released -ink_env = { package = "ink_env", git = "https://github.com/paritytech/ink", branch = "master" } -ink_metadata = { package = "ink_metadata", git = "https://github.com/paritytech/ink", branch = "master", features = ["derive"] } +ink_env = "4.0.0-alpha.3" +ink_metadata = { package = "ink_metadata", version = "4.0.0-alpha.3" } itertools = "0.10.4" tracing = "0.1.36" nom = "7.1.1" @@ -39,8 +38,7 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -# todo: update to crates.io version once released -ink = { package = "ink", git = "https://github.com/paritytech/ink", branch = "master" } +ink = "4.0.0-alpha.3" [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata