From aca328221473350f087d13c281ebb3de6fe5bdf2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 2 Sep 2021 15:48:21 +0100 Subject: [PATCH 1/5] Update scale-info to 1.0 --- templates/new/_Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index cb3be390..4bafd075 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -13,7 +13,7 @@ ink_storage = { version = "3.0.0-rc4", default-features = false } ink_lang = { version = "3.0.0-rc4", default-features = false } scale = { package = "parity-scale-codec", version = "2.1", default-features = false, features = ["derive"] } -scale-info = { version = "0.6.0", default-features = false, features = ["derive"], optional = true } +scale-info = { version = "1.0.0", default-features = false, features = ["derive"], optional = true } [lib] name = "{{name}}" -- GitLab From be94ae660e6f86588f073b9ee0090ae2d8b38857 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 23 Sep 2021 14:17:30 +0100 Subject: [PATCH 2/5] Change signature of __ink_generate_metadata to support versioned metadata --- templates/tools/generate-metadata/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/tools/generate-metadata/main.rs b/templates/tools/generate-metadata/main.rs index 66ecdde2..2efa726d 100644 --- a/templates/tools/generate-metadata/main.rs +++ b/templates/tools/generate-metadata/main.rs @@ -1,7 +1,7 @@ extern crate contract; extern "Rust" { - fn __ink_generate_metadata() -> ink_metadata::InkProject; + fn __ink_generate_metadata() -> ink_metadata::MetadataVersioned; } fn main() -> Result<(), std::io::Error> { -- GitLab From 1b60ad70ee365c94522bf6ec9724331b30edf741 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 23 Sep 2021 14:18:44 +0100 Subject: [PATCH 3/5] Remove top level metadata version --- metadata/lib.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/metadata/lib.rs b/metadata/lib.rs index 90eebbf1..0448602b 100644 --- a/metadata/lib.rs +++ b/metadata/lib.rs @@ -58,13 +58,9 @@ use serde::{Serialize, Serializer}; use serde_json::{Map, Value}; use url::Url; -const METADATA_VERSION: &str = "0.1.0"; - /// Smart contract metadata. #[derive(Clone, Debug, Serialize)] pub struct ContractMetadata { - #[serde(rename = "metadataVersion")] - metadata_version: semver::Version, source: Source, contract: Contract, #[serde(skip_serializing_if = "Option::is_none")] @@ -82,11 +78,7 @@ impl ContractMetadata { user: Option, abi: Map, ) -> Self { - let metadata_version = semver::Version::parse(METADATA_VERSION) - .expect("METADATA_VERSION is a valid semver string"); - Self { - metadata_version, source, contract, user, -- GitLab From 7dd600a7ae1ae1ba36f6727e745c5fa9e32b1b7b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 16:48:38 +0100 Subject: [PATCH 4/5] Bump template to rc6 ink! --- 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 7e2015b8..5999a163 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -6,11 +6,11 @@ edition = "2018" resolver = "2" [dependencies] -ink_primitives = { version = "3.0.0-rc5", default-features = false } -ink_metadata = { version = "3.0.0-rc5", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.0.0-rc5", default-features = false } -ink_storage = { version = "3.0.0-rc5", default-features = false } -ink_lang = { version = "3.0.0-rc5", default-features = false } +ink_primitives = { version = "3.0.0-rc6", default-features = false } +ink_metadata = { version = "3.0.0-rc6", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "3.0.0-rc6", default-features = false } +ink_storage = { version = "3.0.0-rc6", default-features = false } +ink_lang = { version = "3.0.0-rc6", default-features = false } scale = { package = "parity-scale-codec", version = "2.1", default-features = false, features = ["derive"] } scale-info = { version = "1.0.0", default-features = false, features = ["derive"], optional = true } -- GitLab From f009e85831cab919d8d0dc82309173cef5294aa6 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 17:01:58 +0100 Subject: [PATCH 5/5] Fix unit tests --- metadata/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/metadata/lib.rs b/metadata/lib.rs index 0448602b..929c6d57 100644 --- a/metadata/lib.rs +++ b/metadata/lib.rs @@ -553,7 +553,6 @@ mod tests { let expected = json! { { - "metadataVersion": "0.1.0", "source": { "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "language": "ink! 2.1.0", @@ -618,12 +617,6 @@ mod tests { let expected = json! { { - "metadataVersion": "0.1.0", - "source": { - "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "language": "ink! 2.1.0", - "compiler": "rustc 1.46.0-nightly" - }, "contract": { "name": "incrementer", "version": "2.1.0", @@ -631,6 +624,11 @@ mod tests { "Parity Technologies " ], }, + "source": { + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "language": "ink! 2.1.0", + "compiler": "rustc 1.46.0-nightly" + }, // these fields are part of the flattened raw json for the contract ABI "spec": {}, "storage": {}, -- GitLab