mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-24 17:07:58 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user