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
+7 -1
View File
@@ -10,7 +10,10 @@ use std::{
io::Read,
path::PathBuf,
};
use subxt_codegen::DerivesRegistry;
use subxt_codegen::{
DerivesRegistry,
TypeSubstitutes,
};
/// Generate runtime API client code from metadata.
///
@@ -95,10 +98,13 @@ fn codegen(
derives.extend_for_type(ty, std::iter::once(derive), &crate_path)
}
let type_substitutes = TypeSubstitutes::new(&crate_path);
let runtime_api = subxt_codegen::generate_runtime_api_from_bytes(
item_mod,
metadata_bytes,
derives,
type_substitutes,
crate_path,
);
println!("{}", runtime_api);