diff --git a/metadata/lib.rs b/metadata/lib.rs index 90eebbf1328e95ee9d2a2edfaa3715ed6f4b621f..929c6d57d420cfd16f252338796a4cdc42b3d914 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, @@ -561,7 +553,6 @@ mod tests { let expected = json! { { - "metadataVersion": "0.1.0", "source": { "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "language": "ink! 2.1.0", @@ -626,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", @@ -639,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": {}, diff --git a/templates/new/_Cargo.toml b/templates/new/_Cargo.toml index 341303636a75304c9d3a28b7594163884c4382bd..5999a1634e1e37fe41b53bb89ee20ae2e3c83845 100644 --- a/templates/new/_Cargo.toml +++ b/templates/new/_Cargo.toml @@ -6,14 +6,14 @@ 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 = "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}}" diff --git a/templates/tools/generate-metadata/main.rs b/templates/tools/generate-metadata/main.rs index 66ecdde260fdbe2b71457e3f7dd0f0d5e153a097..2efa726dd5fb331638ae26cbb0352b085df2f183 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> {