From 20815b7f84977b18ac80c5ab0a68c739f08d781a Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 7 Feb 2022 17:36:46 +0200 Subject: [PATCH 1/7] cli: Remove whitespaces from readme Signed-off-by: Alexandru Vasile --- cli/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/README.md b/cli/README.md index ce7fdadc688..ecc28d0da31 100644 --- a/cli/README.md +++ b/cli/README.md @@ -7,10 +7,10 @@ USAGE: subxt FLAGS: --h, --help +-h, --help Prints help information - -V, --version + -V, --version Prints version information @@ -38,8 +38,8 @@ OPTIONS: ## Codegen Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the the runtime API and types. Useful -for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the -generated code if the macro does not produce the desired API. e.g. +for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the +generated code if the macro does not produce the desired API. e.g. `subxt codegen | rustfmt --edition=2018 --emit=stdout` @@ -48,10 +48,10 @@ USAGE: subxt codegen [OPTIONS] OPTIONS: - -f, --file + -f, --file the path to the encoded metadata file - --url + --url the url of the substrate node to query for metadata for codegen ``` From 61684de761c3804d6d31f539402539e42b5f4bee Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 7 Feb 2022 17:37:22 +0200 Subject: [PATCH 2/7] cli: Fix typo Signed-off-by: Alexandru Vasile --- cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/README.md b/cli/README.md index ecc28d0da31..813dc2b9f7b 100644 --- a/cli/README.md +++ b/cli/README.md @@ -37,7 +37,7 @@ OPTIONS: ## Codegen -Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the the runtime API and types. Useful +Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the runtime API and types. Useful for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the generated code if the macro does not produce the desired API. e.g. From 08269baa5eba1b229e34173d2ae874c9d6ad250d Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 7 Feb 2022 17:39:10 +0200 Subject: [PATCH 3/7] subxt: Modify codegen path Signed-off-by: Alexandru Vasile --- subxt/tests/integration/codegen/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subxt/tests/integration/codegen/mod.rs b/subxt/tests/integration/codegen/mod.rs index 0c4beca5894..0c75e3e7e7e 100644 --- a/subxt/tests/integration/codegen/mod.rs +++ b/subxt/tests/integration/codegen/mod.rs @@ -20,7 +20,7 @@ /// Generate by: /// /// - run `polkadot --dev --tmp` node locally -/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` +/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > subxt/tests/integration/codegen/polkadot.rs` #[rustfmt::skip] #[allow(clippy::all)] mod polkadot; From 1f333c4bbcd40a46bf54f4d18cadca69066edc42 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 14 Feb 2022 17:43:58 +0200 Subject: [PATCH 4/7] subxt: Remove rustfmt arguments Signed-off-by: Alexandru Vasile --- subxt/tests/integration/codegen/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subxt/tests/integration/codegen/mod.rs b/subxt/tests/integration/codegen/mod.rs index 0c75e3e7e7e..4f35f5d3e95 100644 --- a/subxt/tests/integration/codegen/mod.rs +++ b/subxt/tests/integration/codegen/mod.rs @@ -20,7 +20,7 @@ /// Generate by: /// /// - run `polkadot --dev --tmp` node locally -/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > subxt/tests/integration/codegen/polkadot.rs` +/// - `cargo run --release -p subxt-cli -- codegen | rustfmt > subxt/tests/integration/codegen/polkadot.rs` #[rustfmt::skip] #[allow(clippy::all)] mod polkadot; From c1142914760fa54c5f1a8d27d86b0e4207334d42 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 14 Feb 2022 17:47:00 +0200 Subject: [PATCH 5/7] cli: Update Readme Signed-off-by: Alexandru Vasile --- cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/README.md b/cli/README.md index 813dc2b9f7b..c282dbf01df 100644 --- a/cli/README.md +++ b/cli/README.md @@ -38,7 +38,7 @@ OPTIONS: ## Codegen Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the runtime API and types. Useful -for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the +for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility to customize the generated code if the macro does not produce the desired API. e.g. `subxt codegen | rustfmt --edition=2018 --emit=stdout` From 9f9eca7ce0c6afbb395a76f4d06f3a14dde8f908 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 14 Feb 2022 17:47:11 +0200 Subject: [PATCH 6/7] examples: Fix typo Signed-off-by: Alexandru Vasile --- examples/examples/custom_type_derives.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs index 5c071be250d..4e55cd2c94e 100644 --- a/examples/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -22,7 +22,7 @@ runtime_metadata_path = "examples/polkadot_metadata.scale", // We can add (certain) custom derives to the generated types by providing // a comma separated list to the below attribute. Most useful for adding `Clone`. - // The derives that we can add ultiamtely is limited to the traits that the base + // The derives that we can add ultimately is limited to the traits that the base // types relied upon by the codegen implement. generated_type_derives = "Clone, PartialEq" )] From 5fa4e54fb959bf23c9376fd9b7092e778b12483e Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 14 Feb 2022 18:11:21 +0200 Subject: [PATCH 7/7] subxt: Add Hash for WrapperKeepOpaque and PhantomDataSendSync Signed-off-by: Alexandru Vasile --- examples/examples/custom_type_derives.rs | 2 +- subxt/src/lib.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs index 4e55cd2c94e..12527de5d8a 100644 --- a/examples/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -24,7 +24,7 @@ // a comma separated list to the below attribute. Most useful for adding `Clone`. // The derives that we can add ultimately is limited to the traits that the base // types relied upon by the codegen implement. - generated_type_derives = "Clone, PartialEq" + generated_type_derives = "Clone, PartialEq, Hash" )] pub mod polkadot {} diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index cf8890fe815..21a0cfd4944 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -180,7 +180,8 @@ pub enum Phase { Clone(bound = ""), PartialEq(bound = ""), Eq(bound = ""), - Default(bound = "") + Default(bound = ""), + Hash(bound = "") )] pub struct WrapperKeepOpaque { data: Vec, @@ -223,7 +224,8 @@ impl WrapperKeepOpaque { PartialEq(bound = ""), Debug(bound = ""), Eq(bound = ""), - Default(bound = "") + Default(bound = ""), + Hash(bound = "") )] #[scale_info(skip_type_params(T))] #[doc(hidden)]