From a18476b1de2be440ae0191cd88a527fa16509085 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 11 Jul 2022 15:47:28 -0400 Subject: [PATCH 01/21] Format `transcode`'s `lib.rs` --- transcode/src/lib.rs | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index 1b882d667..34cc1e205 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -89,32 +89,15 @@ mod transcoder; mod util; pub use self::{ - scon::{ - Map, - Value, - }, - transcoder::{ - Transcoder, - TranscoderBuilder, - }, + scon::{Map, Value}, + transcoder::{Transcoder, TranscoderBuilder}, }; use anyhow::Result; -use ink_metadata::{ - ConstructorSpec, - InkProject, - MessageSpec, -}; -use scale::{ - Compact, - Decode, - Input, -}; +use ink_metadata::{ConstructorSpec, InkProject, MessageSpec}; +use scale::{Compact, Decode, Input}; use scale_info::{ - form::{ - Form, - PortableForm, - }, + form::{Form, PortableForm}, Field, }; use std::fmt::Debug; @@ -319,14 +302,12 @@ impl CompositeTypeFields { } else if fields.iter().all(|f| f.name().is_some()) { let fields = fields .iter() - .map(|field| { - CompositeTypeNamedField { - name: field - .name() - .expect("All fields have a name; qed") - .to_owned(), - field: field.clone(), - } + .map(|field| CompositeTypeNamedField { + name: field + .name() + .expect("All fields have a name; qed") + .to_owned(), + field: field.clone(), }) .collect(); Ok(Self::Named(fields)) From 2f203c43bad92c4dae93e3b1083d9e4d48d39439 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 11 Jul 2022 15:55:04 -0400 Subject: [PATCH 02/21] Use `InkProject` directly instead of `MetadataVersioned` --- src/cmd/extrinsics/mod.rs | 53 ++++++++--------------- templates/tools/generate-metadata/main.rs | 12 ++--- transcode/README.md | 10 +++-- transcode/src/lib.rs | 7 +-- 4 files changed, 36 insertions(+), 46 deletions(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index a54d8cc24..ca9fead73 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -24,40 +24,22 @@ mod upload; #[cfg(feature = "integration-tests")] mod integration_tests; -use anyhow::{ - anyhow, - Context, - Result, -}; -use std::{ - fs::File, - path::PathBuf, -}; +use anyhow::{anyhow, Context, Result}; +use std::{fs::File, path::PathBuf}; use self::events::display_events; use crate::{ - crate_metadata::CrateMetadata, - name_value_println, - workspace::ManifestPath, - Verbosity, - VerbosityFlags, + crate_metadata::CrateMetadata, name_value_println, workspace::ManifestPath, + Verbosity, VerbosityFlags, }; use pallet_contracts_primitives::ContractResult; -use sp_core::{ - crypto::Pair, - sr25519, -}; -use subxt::{ - Config, - DefaultConfig, - HasModuleError as _, -}; +use sp_core::{crypto::Pair, sr25519}; +use subxt::{Config, DefaultConfig, HasModuleError as _}; pub use call::CallCommand; pub use instantiate::InstantiateCommand; pub use runtime_api::api::{ - DispatchError as RuntimeDispatchError, - Event as RuntimeEvent, + DispatchError as RuntimeDispatchError, Event as RuntimeEvent, }; pub use transcode::ContractMessageTranscoder; pub use upload::UploadCommand; @@ -136,7 +118,7 @@ pub fn load_metadata( if !path.exists() { return Err(anyhow!( "Metadata file not found. Try building with `cargo contract build`." - )) + )); } let file = File::open(&path) @@ -146,15 +128,18 @@ pub fn load_metadata( "Failed to deserialize metadata file {}", path.display() ))?; - let ink_metadata = serde_json::from_value(serde_json::Value::Object(metadata.abi)) - .context(format!( - "Failed to deserialize ink project metadata from file {}", - path.display() - ))?; - if let ink_metadata::MetadataVersioned::V3(ink_project) = ink_metadata { - Ok((crate_metadata, ink_project)) + let ink_metadata: ink_metadata::InkProject = serde_json::from_value( + serde_json::Value::Object(metadata.abi), + ) + .context(format!( + "Failed to deserialize ink! project metadata from file {}", + path.display() + ))?; + + if let ink_metadata::MetadataVersion::V3 = ink_metadata.version() { + Ok((crate_metadata, ink_metadata)) } else { - Err(anyhow!("Unsupported ink metadata version. Expected V1")) + Err(anyhow!("Unsupported ink metadata version. Expected V3")) } } diff --git a/templates/tools/generate-metadata/main.rs b/templates/tools/generate-metadata/main.rs index 2efa726dd..c703267b4 100644 --- a/templates/tools/generate-metadata/main.rs +++ b/templates/tools/generate-metadata/main.rs @@ -1,12 +1,14 @@ extern crate contract; extern "Rust" { - fn __ink_generate_metadata() -> ink_metadata::MetadataVersioned; + // 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 main() -> Result<(), std::io::Error> { - let metadata = unsafe { __ink_generate_metadata() }; - let contents = serde_json::to_string_pretty(&metadata)?; - print!("{}", contents); - Ok(()) + let metadata = unsafe { __ink_generate_metadata() }; + let contents = serde_json::to_string_pretty(&metadata)?; + print!("{}", contents); + Ok(()) } diff --git a/transcode/README.md b/transcode/README.md index 1a1c9d5a5..b7c7eacb3 100644 --- a/transcode/README.md +++ b/transcode/README.md @@ -28,11 +28,13 @@ fn load_metadata(path: &Path) -> anyhow::Result { let file = File::open(&path).expect("Failed to open metadata file"); let metadata: ContractMetadata = serde_json::from_reader(file).expect("Failed to deserialize metadata file"); - let ink_metadata = serde_json::from_value(serde_json::Value::Object(metadata.abi)) - .expect("Failed to deserialize ink project metadata"); - if let ink_metadata::MetadataVersioned::V3(ink_project) = ink_metadata { - Ok(ink_project) + let ink_metadata: ink_metadata::InkProject = serde_json::from_value( + serde_json::Value::Object(metadata.abi), + ).expect("Failed to deserialize ink project metadata"); + + if let ink_metadata::MetadataVersion::V3 = ink_metadata.version() { + Ok(ink_metadata) } else { Err(anyhow!("Unsupported ink metadata version. Expected V3")) } diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index 34cc1e205..f4785e1ab 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -402,10 +402,11 @@ mod tests { fn generate_metadata() -> ink_metadata::InkProject { extern "Rust" { - fn __ink_generate_metadata() -> ink_metadata::MetadataVersioned; + fn __ink_generate_metadata() -> ink_metadata::InkProject; } - let metadata_versioned = unsafe { __ink_generate_metadata() }; - if let ink_metadata::MetadataVersioned::V3(ink_project) = metadata_versioned { + + let ink_project = unsafe { __ink_generate_metadata() }; + if let ink_metadata::MetadataVersion::V3 = ink_project.version() { ink_project } else { panic!("Expected metadata V3"); From a684e1b0dfbb9488ff4a1f6be9f9d1b46d85463a Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Mon, 11 Jul 2022 16:09:05 -0400 Subject: [PATCH 03/21] Patch ink dependencies to point to development branch --- Cargo.lock | 62 ++++++++++++++++++-------------------------- Cargo.toml | 2 +- transcode/Cargo.toml | 12 ++++----- 3 files changed, 32 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01017cadf..418e2a41e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1398,18 +1398,16 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed249de74298ed051ebcf6d3082b8d3dbd19cbc448d9ed3235d8a7b92713049" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "cfg-if", ] [[package]] name = "ink_engine" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb9d32ec27d71fefb3f2b6a26bae82a2c6509d7ad61e8a5107b6291a1b03ecb" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "blake2", "derive_more", @@ -1422,9 +1420,8 @@ dependencies = [ [[package]] name = "ink_env" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1549f5966167387c89fb3dfcdc59973bfb396cc3a7110d7a31ad5fdea56db0cf" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "arrayref", "blake2", @@ -1449,9 +1446,8 @@ dependencies = [ [[package]] name = "ink_lang" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5282f2722ac6dca469e7f223a7b38b2a6d20fbca6b974497e630d5dc8934e9" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "derive_more", "ink_env", @@ -1465,9 +1461,8 @@ dependencies = [ [[package]] name = "ink_lang_codegen" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3a5de33b59450adc3f61c5eb05b768067c7ab8af9d00f33e284310598168dc" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "blake2", "derive_more", @@ -1484,9 +1479,8 @@ dependencies = [ [[package]] name = "ink_lang_ir" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d4d614462280fa06e15b9ca5725d7c8440dde93c8dae1c6f15422f7756cacb" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "blake2", "either", @@ -1498,9 +1492,8 @@ dependencies = [ [[package]] name = "ink_lang_macro" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f85f64141957c5db7cbabbb97a9c16c489e5e9d363e9f147d132a43c71cd29" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1512,9 +1505,8 @@ dependencies = [ [[package]] name = "ink_metadata" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca6c159a2774f07437c6fd9ea710eb73a6b5e9a031a932bddf08742bf2c081a" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "derive_more", "impl-serde", @@ -1526,18 +1518,16 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f7f4dec15e573496c9d2af353e78bde84add391251608f25b5adcf175dc777" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3296dd1c4f4fe12ede7c92d60e6fcb94d46a959ec19c701e4ac588b09e0b4a6" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "cfg-if", "ink_prelude", @@ -1547,9 +1537,8 @@ dependencies = [ [[package]] name = "ink_storage" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff9b503995a7b41fe201a7a2643ce22f5a11e0b67db7b685424b6d5fe0ecf0b" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "array-init", "cfg-if", @@ -1565,9 +1554,8 @@ dependencies = [ [[package]] name = "ink_storage_derive" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb68e24e93e8327dda1924868d7ee4dbe01e1ed2b392f28583caa96809b585c" +version = "3.2.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" dependencies = [ "proc-macro2", "quote", @@ -3620,7 +3608,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", ] diff --git a/Cargo.toml b/Cargo.toml index d5bce7189..ef5585787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ regex = "1.6.0" # dependencies for extrinsics (deploying and calling a contract) async-std = { version = "1.12.0", features = ["attributes", "tokio1"] } -ink_metadata = { version = "3.3", features = ["derive"] } +ink_metadata = { version = "3", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } sp-core = "6.0.0" pallet-contracts-primitives = "6.0.0" subxt = "0.22.0" diff --git a/transcode/Cargo.toml b/transcode/Cargo.toml index da8a35454..cabc92ba3 100644 --- a/transcode/Cargo.toml +++ b/transcode/Cargo.toml @@ -23,8 +23,8 @@ env_logger = "0.9.0" escape8259 = "0.5.1" hex = "0.4.3" indexmap = "1.9.1" -ink_env = "3.3" -ink_metadata = { version = "3.3", features = ["derive"] } +ink_env = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "3", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } itertools = "0.10.3" log = "0.4.17" nom = "7.1.1" @@ -38,12 +38,12 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink_lang = "3.3" -ink_primitives = "3.3" -ink_storage = "3.3" +ink_lang = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_primitives = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_storage = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata # generation code with `#[cfg(feature = "std")]`. default = ["std"] -std = [] \ No newline at end of file +std = [] From 7472a76f13a7a1b3f81c0d62931c5415ebbe6bb2 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 11:23:51 -0400 Subject: [PATCH 04/21] Use same nightly compiler as CI to format code --- src/cmd/extrinsics/mod.rs | 34 ++++++++++++++++++++++++-------- transcode/src/lib.rs | 41 ++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index ca9fead73..4d370c0ee 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -24,22 +24,40 @@ mod upload; #[cfg(feature = "integration-tests")] mod integration_tests; -use anyhow::{anyhow, Context, Result}; -use std::{fs::File, path::PathBuf}; +use anyhow::{ + anyhow, + Context, + Result, +}; +use std::{ + fs::File, + path::PathBuf, +}; use self::events::display_events; use crate::{ - crate_metadata::CrateMetadata, name_value_println, workspace::ManifestPath, - Verbosity, VerbosityFlags, + crate_metadata::CrateMetadata, + name_value_println, + workspace::ManifestPath, + Verbosity, + VerbosityFlags, }; use pallet_contracts_primitives::ContractResult; -use sp_core::{crypto::Pair, sr25519}; -use subxt::{Config, DefaultConfig, HasModuleError as _}; +use sp_core::{ + crypto::Pair, + sr25519, +}; +use subxt::{ + Config, + DefaultConfig, + HasModuleError as _, +}; pub use call::CallCommand; pub use instantiate::InstantiateCommand; pub use runtime_api::api::{ - DispatchError as RuntimeDispatchError, Event as RuntimeEvent, + DispatchError as RuntimeDispatchError, + Event as RuntimeEvent, }; pub use transcode::ContractMessageTranscoder; pub use upload::UploadCommand; @@ -118,7 +136,7 @@ pub fn load_metadata( if !path.exists() { return Err(anyhow!( "Metadata file not found. Try building with `cargo contract build`." - )); + )) } let file = File::open(&path) diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index f4785e1ab..38a7463e0 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -89,15 +89,32 @@ mod transcoder; mod util; pub use self::{ - scon::{Map, Value}, - transcoder::{Transcoder, TranscoderBuilder}, + scon::{ + Map, + Value, + }, + transcoder::{ + Transcoder, + TranscoderBuilder, + }, }; use anyhow::Result; -use ink_metadata::{ConstructorSpec, InkProject, MessageSpec}; -use scale::{Compact, Decode, Input}; +use ink_metadata::{ + ConstructorSpec, + InkProject, + MessageSpec, +}; +use scale::{ + Compact, + Decode, + Input, +}; use scale_info::{ - form::{Form, PortableForm}, + form::{ + Form, + PortableForm, + }, Field, }; use std::fmt::Debug; @@ -302,12 +319,14 @@ impl CompositeTypeFields { } else if fields.iter().all(|f| f.name().is_some()) { let fields = fields .iter() - .map(|field| CompositeTypeNamedField { - name: field - .name() - .expect("All fields have a name; qed") - .to_owned(), - field: field.clone(), + .map(|field| { + CompositeTypeNamedField { + name: field + .name() + .expect("All fields have a name; qed") + .to_owned(), + field: field.clone(), + } }) .collect(); Ok(Self::Named(fields)) From f728a5f3914b3738f06680811c2ba64ebd2d4922 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 16:58:11 -0400 Subject: [PATCH 05/21] Use updated ink! dependences in template --- templates/new/_Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index 1815c19ee..0a672f25b 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -5,11 +5,11 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -ink_primitives = { version = "3.3", default-features = false } -ink_metadata = { version = "3.3", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.3", default-features = false } -ink_storage = { version = "3.3", default-features = false } -ink_lang = { version = "3.3", default-features = false } +ink_primitives = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "3", default-features = false, features = ["derive"], optional = true, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_env = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_storage = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_lang = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } From 7bb61dd8d287643c46d5896f8f1006c76f39274f Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:14:04 -0400 Subject: [PATCH 06/21] Bump lockfile --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb40e3f37..ccc4dd775 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1399,7 +1399,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "cfg-if", ] @@ -1407,7 +1407,7 @@ dependencies = [ [[package]] name = "ink_engine" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "blake2", "derive_more", @@ -1421,7 +1421,7 @@ dependencies = [ [[package]] name = "ink_env" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "arrayref", "blake2", @@ -1447,7 +1447,7 @@ dependencies = [ [[package]] name = "ink_lang" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "derive_more", "ink_env", @@ -1462,7 +1462,7 @@ dependencies = [ [[package]] name = "ink_lang_codegen" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "blake2", "derive_more", @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "ink_lang_ir" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "blake2", "either", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "ink_lang_macro" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1506,7 +1506,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "derive_more", "impl-serde", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "cfg-if", ] @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "ink_primitives" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "cfg-if", "ink_prelude", @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "ink_storage" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "array-init", "cfg-if", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "ink_storage_derive" version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#970b5d794289a120459e37aee468bb90c16468b5" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" dependencies = [ "proc-macro2", "quote", From e24996d77fee8d33b862297703dcaedcc781e86d Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:16:41 -0400 Subject: [PATCH 07/21] Bump expected metadata version to V4 --- src/cmd/extrinsics/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index 4d370c0ee..7dde7ff4d 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -154,10 +154,10 @@ pub fn load_metadata( path.display() ))?; - if let ink_metadata::MetadataVersion::V3 = ink_metadata.version() { + if let ink_metadata::MetadataVersion::V4 = ink_metadata.version() { Ok((crate_metadata, ink_metadata)) } else { - Err(anyhow!("Unsupported ink metadata version. Expected V3")) + Err(anyhow!("Unsupported ink metadata version. Expected V4")) } } From 1cb063e825bcd12138a374629a296b07217c33d1 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:29:28 -0400 Subject: [PATCH 08/21] Bump to V4 in a couple more places --- transcode/README.md | 4 ++-- transcode/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transcode/README.md b/transcode/README.md index b7c7eacb3..ec12553b1 100644 --- a/transcode/README.md +++ b/transcode/README.md @@ -33,10 +33,10 @@ fn load_metadata(path: &Path) -> anyhow::Result { serde_json::Value::Object(metadata.abi), ).expect("Failed to deserialize ink project metadata"); - if let ink_metadata::MetadataVersion::V3 = ink_metadata.version() { + if let ink_metadata::MetadataVersion::V4 = ink_metadata.version() { Ok(ink_metadata) } else { - Err(anyhow!("Unsupported ink metadata version. Expected V3")) + Err(anyhow!("Unsupported ink metadata version. Expected V4")) } } diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index 38a7463e0..5267fa01c 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -425,10 +425,10 @@ mod tests { } let ink_project = unsafe { __ink_generate_metadata() }; - if let ink_metadata::MetadataVersion::V3 = ink_project.version() { + if let ink_metadata::MetadataVersion::V4 = ink_project.version() { ink_project } else { - panic!("Expected metadata V3"); + panic!("Expected metadata V4"); } } From befcc3bc34c95886bd45a1fd8d1da172e2bf153a Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:36:47 -0400 Subject: [PATCH 09/21] Clear cache before running tests --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c0066297..70001f36c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -128,6 +128,7 @@ test: <<: *docker-env script: - rusty-cachier snapshot create + - cargo clean - cargo test --verbose --workspace --all-features - rusty-cachier cache upload @@ -190,7 +191,7 @@ build: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: + script - rusty-cachier snapshot create - cargo build --verbose --release - rusty-cachier cache upload From b797c3ebca8bcf58f7405227e9659d6ecf3b41ef Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:39:27 -0400 Subject: [PATCH 10/21] Add missing colon --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70001f36c..ad4614bb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -191,7 +191,7 @@ build: - if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script + script: - rusty-cachier snapshot create - cargo build --verbose --release - rusty-cachier cache upload From 17612e25187af07874ddcfe315548666dd2f6383 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Thu, 14 Jul 2022 17:41:41 -0400 Subject: [PATCH 11/21] Looks like the directory doesn't want to be cleaned --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad4614bb7..5c0066297 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -128,7 +128,6 @@ test: <<: *docker-env script: - rusty-cachier snapshot create - - cargo clean - cargo test --verbose --workspace --all-features - rusty-cachier cache upload From c55b7195aef73be0fecb0cd8b8dbee260af31375 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Fri, 15 Jul 2022 13:10:29 -0400 Subject: [PATCH 12/21] Bump to ink! 4.0 pre-release --- Cargo.lock | 48 +++++++++++++++++++-------------------- Cargo.toml | 2 +- src/main.rs | 2 +- templates/new/_Cargo.toml | 10 ++++---- transcode/Cargo.toml | 10 ++++---- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccc4dd775..71b73987a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1398,16 +1398,16 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "cfg-if", ] [[package]] name = "ink_engine" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "blake2", "derive_more", @@ -1420,8 +1420,8 @@ dependencies = [ [[package]] name = "ink_env" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "arrayref", "blake2", @@ -1446,8 +1446,8 @@ dependencies = [ [[package]] name = "ink_lang" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "derive_more", "ink_env", @@ -1461,8 +1461,8 @@ dependencies = [ [[package]] name = "ink_lang_codegen" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "blake2", "derive_more", @@ -1479,8 +1479,8 @@ dependencies = [ [[package]] name = "ink_lang_ir" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "blake2", "either", @@ -1492,8 +1492,8 @@ dependencies = [ [[package]] name = "ink_lang_macro" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1505,8 +1505,8 @@ dependencies = [ [[package]] name = "ink_metadata" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "derive_more", "impl-serde", @@ -1518,16 +1518,16 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "cfg-if", "ink_prelude", @@ -1537,8 +1537,8 @@ dependencies = [ [[package]] name = "ink_storage" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "array-init", "cfg-if", @@ -1554,8 +1554,8 @@ dependencies = [ [[package]] name = "ink_storage_derive" -version = "3.2.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#f609741cbb942a7b2020fb99132e91f492753209" +version = "4.0.0" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 86668841e..930979408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ regex = "1.6.0" # dependencies for extrinsics (deploying and calling a contract) async-std = { version = "1.12.0", features = ["attributes", "tokio1"] } -ink_metadata = { version = "3", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } sp-core = "6.0.0" pallet-contracts-primitives = "6.0.0" subxt = "0.22.0" diff --git a/src/main.rs b/src/main.rs index 6819209dc..d027ef4a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with cargo-contract. If not, see . -#![deny(unused_crate_dependencies)] +// #![deny(unused_crate_dependencies)] mod cmd; mod crate_metadata; diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index 0a672f25b..2288c9ef4 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -5,11 +5,11 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -ink_primitives = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_metadata = { version = "3", default-features = false, features = ["derive"], optional = true, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_env = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_storage = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_lang = { version = "3", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_primitives = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "4", default-features = false, features = ["derive"], optional = true, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_env = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_storage = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_lang = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } 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/transcode/Cargo.toml b/transcode/Cargo.toml index cabc92ba3..745efdc9d 100644 --- a/transcode/Cargo.toml +++ b/transcode/Cargo.toml @@ -23,8 +23,8 @@ env_logger = "0.9.0" escape8259 = "0.5.1" hex = "0.4.3" indexmap = "1.9.1" -ink_env = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_metadata = { version = "3", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_env = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } itertools = "0.10.3" log = "0.4.17" nom = "7.1.1" @@ -38,9 +38,9 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink_lang = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_primitives = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_storage = { version = "3", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_lang = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_primitives = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_storage = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata From 66cf72fb20038e83e46712e73997006cd2cc5bec Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 9 Aug 2022 16:03:43 -0400 Subject: [PATCH 13/21] Bump ink! version --- Cargo.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cc45e235..1d52afc68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1399,7 +1399,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "cfg-if", ] @@ -1407,13 +1407,13 @@ dependencies = [ [[package]] name = "ink_engine" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "blake2", "derive_more", "parity-scale-codec", "rand 0.8.5", - "secp256k1 0.22.1", + "secp256k1 0.24.0", "sha2 0.10.2", "sha3", ] @@ -1421,7 +1421,7 @@ dependencies = [ [[package]] name = "ink_env" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "arrayref", "blake2", @@ -1438,7 +1438,7 @@ dependencies = [ "rand 0.8.5", "rlibc", "scale-info", - "secp256k1 0.22.1", + "secp256k1 0.24.0", "sha2 0.10.2", "sha3", "static_assertions", @@ -1447,7 +1447,7 @@ dependencies = [ [[package]] name = "ink_lang" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "derive_more", "ink_env", @@ -1462,7 +1462,7 @@ dependencies = [ [[package]] name = "ink_lang_codegen" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "blake2", "derive_more", @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "ink_lang_ir" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "blake2", "either", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "ink_lang_macro" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1506,7 +1506,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "derive_more", "impl-serde", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "cfg-if", ] @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "ink_primitives" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "cfg-if", "ink_prelude", @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "ink_storage" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "array-init", "cfg-if", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "ink_storage_derive" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#6ecab57e6bb297d9cdd42bcedbef785e72de8e8b" +source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" dependencies = [ "proc-macro2", "quote", @@ -2719,11 +2719,11 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.22.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff" dependencies = [ - "secp256k1-sys 0.5.2", + "secp256k1-sys 0.6.0", ] [[package]] @@ -2737,9 +2737,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b" dependencies = [ "cc", ] From a1c354b907604d1dcbf8614f915122c81340f7c2 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 9 Aug 2022 16:16:45 -0400 Subject: [PATCH 14/21] Remove metadata version check There's only one metadata version that can be constructed, so the check doesn't totally make sense. In the future if we support both V4 and V5 metadata formats it would make sense to add such a check back. --- src/cmd/extrinsics/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index 7dde7ff4d..8413bd95d 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -154,11 +154,7 @@ pub fn load_metadata( path.display() ))?; - if let ink_metadata::MetadataVersion::V4 = ink_metadata.version() { - Ok((crate_metadata, ink_metadata)) - } else { - Err(anyhow!("Unsupported ink metadata version. Expected V4")) - } + Ok((crate_metadata, ink_metadata)) } /// Parse Rust style integer balance literals which can contain underscores. From 732e9f3fa74227d019d5452c11d6762dabb5cadd Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 23 Aug 2022 15:58:05 -0400 Subject: [PATCH 15/21] Appease Clippy --- src/cmd/extrinsics/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index f7fde78b1..2d7c72d48 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -58,7 +58,6 @@ use scale::{ Decode, Encode, }; -use serde_json::Value; use sp_core::{ crypto::Pair, sr25519, From cb45b64991d8d8f14cb1fd1945b32ff582775104 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 23 Aug 2022 16:04:04 -0400 Subject: [PATCH 16/21] Move away from ink!'s `hc-versioned-metadata` branch --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 2 +- templates/new/_Cargo.toml | 10 +++++----- transcode/Cargo.toml | 10 +++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 94d186cb1..2478511af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1420,7 +1420,7 @@ dependencies = [ [[package]] name = "ink_allocator" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "cfg-if", ] @@ -1428,7 +1428,7 @@ dependencies = [ [[package]] name = "ink_engine" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "blake2", "derive_more", @@ -1442,7 +1442,7 @@ dependencies = [ [[package]] name = "ink_env" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "arrayref", "blake2", @@ -1468,7 +1468,7 @@ dependencies = [ [[package]] name = "ink_lang" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "derive_more", "ink_env", @@ -1483,7 +1483,7 @@ dependencies = [ [[package]] name = "ink_lang_codegen" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "blake2", "derive_more", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "ink_lang_ir" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "blake2", "either", @@ -1514,7 +1514,7 @@ dependencies = [ [[package]] name = "ink_lang_macro" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "ink_metadata" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "derive_more", "impl-serde", @@ -1540,7 +1540,7 @@ dependencies = [ [[package]] name = "ink_prelude" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "cfg-if", ] @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "ink_primitives" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "cfg-if", "ink_prelude", @@ -1559,7 +1559,7 @@ dependencies = [ [[package]] name = "ink_storage" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "array-init", "cfg-if", @@ -1576,7 +1576,7 @@ dependencies = [ [[package]] name = "ink_storage_derive" version = "4.0.0" -source = "git+https://github.com/paritytech/ink?branch=hc-versioned-metadata#5b456d70aa2455462e57ea20c7b37d6fc6327dc8" +source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index cad5b1f0b..43f086ed8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ regex = "1.6.0" # dependencies for extrinsics (deploying and calling a contract) async-std = { version = "1.12.0", features = ["attributes", "tokio1"] } -ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink" } sp-core = "6.0.0" pallet-contracts-primitives = "6.0.0" subxt = "0.23.0" diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index 2288c9ef4..a0605417a 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -5,11 +5,11 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -ink_primitives = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_metadata = { version = "4", default-features = false, features = ["derive"], optional = true, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_env = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_storage = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_lang = { version = "4", default-features = false, git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_primitives = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } +ink_metadata = { version = "4", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } +ink_storage = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } +ink_lang = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } 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/transcode/Cargo.toml b/transcode/Cargo.toml index 957b41ebe..536893659 100644 --- a/transcode/Cargo.toml +++ b/transcode/Cargo.toml @@ -23,8 +23,8 @@ env_logger = "0.9.0" escape8259 = "0.5.1" hex = "0.4.3" indexmap = "1.9.1" -ink_env = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_env = { version = "4", git = "https://github.com/paritytech/ink" } +ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink" } itertools = "0.10.3" tracing = "0.1.36" nom = "7.1.1" @@ -38,9 +38,9 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink_lang = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_primitives = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } -ink_storage = { version = "4", git = "https://github.com/paritytech/ink", branch = "hc-versioned-metadata" } +ink_lang = { version = "4", git = "https://github.com/paritytech/ink" } +ink_primitives = { version = "4", git = "https://github.com/paritytech/ink" } +ink_storage = { version = "4", git = "https://github.com/paritytech/ink" } [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata From cfdd26228518d4f43a90fd8960c266161b852056 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 24 Aug 2022 12:41:42 -0400 Subject: [PATCH 17/21] Remove metadata version check (again) There's only one metadata version that can be constructed, so the check doesn't totally make sense. In the future if we support both V4 and V5 metadata formats it would make sense to add such a check back. --- transcode/src/lib.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index 549dcc563..d129596c1 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -180,13 +180,8 @@ impl ContractMessageTranscoder { "Failed to deserialize ink project metadata from file {}", path.display() ))?; - if let ink_metadata::MetadataVersioned::V3(ink_project) = ink_metadata { - Ok(Self::new(ink_project)) - } else { - Err(anyhow::anyhow!( - "Unsupported ink metadata version. Expected V1" - )) - } + + Ok(Self::new(ink_metadata)) } pub fn encode(&self, name: &str, args: I) -> Result> From ade95668ab142416f0b4513afaf67f2a8f525d99 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 24 Aug 2022 12:42:01 -0400 Subject: [PATCH 18/21] RustFmt --- src/cmd/extrinsics/mod.rs | 40 ++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/cmd/extrinsics/mod.rs b/src/cmd/extrinsics/mod.rs index c52840f94..574da3df3 100644 --- a/src/cmd/extrinsics/mod.rs +++ b/src/cmd/extrinsics/mod.rs @@ -24,23 +24,49 @@ mod upload; #[cfg(feature = "integration-tests")] mod integration_tests; -use anyhow::{anyhow, Context, Result}; +use anyhow::{ + anyhow, + Context, + Result, +}; use colored::Colorize; -use jsonrpsee::{core::client::ClientT, rpc_params, ws_client::WsClientBuilder}; +use jsonrpsee::{ + core::client::ClientT, + rpc_params, + ws_client::WsClientBuilder, +}; use std::{ - io::{self, Write}, + io::{ + self, + Write, + }, path::PathBuf, }; use self::events::display_events; use crate::{ - crate_metadata::CrateMetadata, name_value_println, Verbosity, VerbosityFlags, + crate_metadata::CrateMetadata, + name_value_println, + Verbosity, + VerbosityFlags, DEFAULT_KEY_COL_WIDTH, }; use pallet_contracts_primitives::ContractResult; -use scale::{Decode, Encode}; -use sp_core::{crypto::Pair, sr25519, Bytes}; -use subxt::{ext::sp_runtime::DispatchError, tx, Config, OnlineClient}; +use scale::{ + Decode, + Encode, +}; +use sp_core::{ + crypto::Pair, + sr25519, + Bytes, +}; +use subxt::{ + ext::sp_runtime::DispatchError, + tx, + Config, + OnlineClient, +}; pub use call::CallCommand; pub use instantiate::InstantiateCommand; From 227523c2e9616cb4fb06d1e2b0bab8ada4bbdb46 Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 24 Aug 2022 12:48:27 -0400 Subject: [PATCH 19/21] Remove another irrefutable `if let` --- transcode/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/transcode/src/lib.rs b/transcode/src/lib.rs index d129596c1..f475cc0b9 100644 --- a/transcode/src/lib.rs +++ b/transcode/src/lib.rs @@ -480,11 +480,7 @@ mod tests { } let ink_project = unsafe { __ink_generate_metadata() }; - if let ink_metadata::MetadataVersion::V4 = ink_project.version() { - ink_project - } else { - panic!("Expected metadata V4"); - } + ink_project } #[test] From 023bb89ecfc42471f00cd6974cd8656eb59fcafa Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 24 Aug 2022 14:54:19 -0400 Subject: [PATCH 20/21] Bump ink! versions to `4.0.0-alpha.1` --- Cargo.lock | 60 +++++++++++++++++++++++---------------- templates/new/_Cargo.toml | 10 +++---- transcode/Cargo.toml | 10 +++---- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cc48afc3..07635264c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1418,16 +1418,18 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51716586362dbfbaf67cdfd1d2e683b7925daf69a437a6fe16ff20583129d7c4" dependencies = [ "cfg-if", ] [[package]] name = "ink_engine" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eece522b2a9d73ae66b28b1ce34a27c2169b8fa35bc0f8f97995f6b9a2387dca" dependencies = [ "blake2", "derive_more", @@ -1440,8 +1442,9 @@ dependencies = [ [[package]] name = "ink_env" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a0fb4e9e5bdc53e6a49f1716d8d89d25b2f4e3bad6f280773fb976ca77a60ff" dependencies = [ "arrayref", "blake2", @@ -1466,8 +1469,9 @@ dependencies = [ [[package]] name = "ink_lang" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30424a655c93946c8e07473acdd5bc584f772a1a86d3d43bf528ceec03f1aa4c" dependencies = [ "derive_more", "ink_env", @@ -1481,8 +1485,9 @@ dependencies = [ [[package]] name = "ink_lang_codegen" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7e0d02c594736048253a0784fd78316a93e186881317aa65b53a7a23c7f750" dependencies = [ "blake2", "derive_more", @@ -1499,8 +1504,9 @@ dependencies = [ [[package]] name = "ink_lang_ir" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab84043bbde9fd0ab685e5f32be92c5223b943a1a30078f1ceae19386df2d32" dependencies = [ "blake2", "either", @@ -1512,8 +1518,9 @@ dependencies = [ [[package]] name = "ink_lang_macro" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63f2bc42f196e8397ec4c87763a4998b0c3ef605a4067e5b7a743812bab9864" dependencies = [ "ink_lang_codegen", "ink_lang_ir", @@ -1525,8 +1532,9 @@ dependencies = [ [[package]] name = "ink_metadata" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0cf9e970d05710b5488ad92c19b9ab94fc6ece973db4f4c8e1e0d2ff59218cf" dependencies = [ "derive_more", "impl-serde", @@ -1538,16 +1546,18 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799f1435d7323a130e13ba599ab801b826e4ea90508c04306cf16615a4f88bba" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a601c52715f3f30eaec72958dddebcf60258e3a4c163719c00258153debe515a" dependencies = [ "cfg-if", "ink_prelude", @@ -1557,8 +1567,9 @@ dependencies = [ [[package]] name = "ink_storage" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c5208bd825a580c5e20e3c6befa001aa2b5e179cd548163baa1e6bac2ab4cb4" dependencies = [ "array-init", "cfg-if", @@ -1574,8 +1585,9 @@ dependencies = [ [[package]] name = "ink_storage_derive" -version = "4.0.0" -source = "git+https://github.com/paritytech/ink#23f42d92e3fbb3cdd3f75d24dc1af11c4e1afc39" +version = "4.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8eb0065ceb70ed1a2afe8e5dc42ad97df9cdd09072aef944ff580ba7768c959" dependencies = [ "proc-macro2", "quote", diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index a0605417a..e63990243 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -5,11 +5,11 @@ authors = ["[your_name] <[your_email]>"] edition = "2021" [dependencies] -ink_primitives = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } -ink_metadata = { version = "4", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } -ink_storage = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } -ink_lang = { version = "4", default-features = false, git = "https://github.com/paritytech/ink" } +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 } 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/transcode/Cargo.toml b/transcode/Cargo.toml index 97b84e422..252ac322d 100644 --- a/transcode/Cargo.toml +++ b/transcode/Cargo.toml @@ -23,8 +23,8 @@ env_logger = "0.9.0" escape8259 = "0.5.2" hex = "0.4.3" indexmap = "1.9.1" -ink_env = { version = "4", git = "https://github.com/paritytech/ink" } -ink_metadata = { version = "4", features = ["derive"], git = "https://github.com/paritytech/ink" } +ink_env = "4.0.0-alpha.1" +ink_metadata = { version = "4.0.0-alpha.1", features = ["derive"] } itertools = "0.10.3" tracing = "0.1.36" nom = "7.1.1" @@ -38,9 +38,9 @@ sp-runtime = "6.0.0" [dev-dependencies] assert_matches = "1.5.0" -ink_lang = { version = "4", git = "https://github.com/paritytech/ink" } -ink_primitives = { version = "4", git = "https://github.com/paritytech/ink" } -ink_storage = { version = "4", git = "https://github.com/paritytech/ink" } +ink_lang = "4.0.0-alpha.1" +ink_primitives = "4.0.0-alpha.1" +ink_storage = "4.0.0-alpha.1" [features] # This `std` feature is required for testing using an inline contract's metadata, because `ink!` annotates the metadata From ed493d05407b9aeb68dbc0c35e072ed67011311e Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Wed, 24 Aug 2022 15:11:36 -0400 Subject: [PATCH 21/21] Deny `unused_crate_dependencies` again --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2d0c76fba..3230b411c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with cargo-contract. If not, see . -// #![deny(unused_crate_dependencies)] +#![deny(unused_crate_dependencies)] mod cmd; mod crate_metadata;