Allow for remapping type parameters in type substitutions (#735)

* feat!: Allow for remapping type parameters in type substitutions

* chore: cargo fmt

* chore: cargo clippy

* chore: Remove some old code

* a little tidy

* address comment nit

Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
Igor Matuszewski
2023-01-19 10:49:57 +00:00
committed by GitHub
parent b7a29a5efe
commit 977f2a3333
14 changed files with 541 additions and 331 deletions
@@ -1,7 +1,10 @@
#[subxt::subxt(runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale")]
pub mod node_runtime {
#[subxt::subxt(substitute_type = "sp_arithmetic::per_things::Perbill")]
use sp_runtime::Perbill;
}
#[subxt::subxt(
runtime_metadata_path = "../../../../artifacts/polkadot_metadata.scale",
substitute_type(
type = "sp_arithmetic::per_things::Perbill",
with = "sp_runtime::Perbill"
)
)]
pub mod node_runtime {}
fn main() {}
@@ -1,5 +1,5 @@
error: The substitute path must be a global absolute path; try prefixing with `::` or `crate`
--> src/incorrect/substitute_path_not_absolute.rs:4:9
--> src/incorrect/substitute_path_not_absolute.rs:5:16
|
4 | use sp_runtime::Perbill;
| ^^^^^^^^^^
5 | with = "sp_runtime::Perbill"
| ^^^^^^^^^^^^^^^^^^^^^