DecodeAsEvent and DecodeAsExtrinsic; make easier to implement by removing consts

This commit is contained in:
James Wilson
2025-12-15 14:20:23 +00:00
parent ae820a2cc8
commit dfabd6609c
4 changed files with 14 additions and 18 deletions
+6 -1
View File
@@ -81,10 +81,15 @@ pub fn generate_calls(
#struct_def
#alias_mod
impl #crate_path::extrinsics::DecodeAsExtrinsic for #struct_name {
impl #struct_name {
const PALLET_NAME: &'static str = #pallet_name;
const CALL_NAME: &'static str = #call_name;
}
impl #crate_path::extrinsics::DecodeAsExtrinsic for #struct_name {
fn is_extrinsic(pallet_name: &str, call_name: &str) -> bool {
pallet_name == Self::PALLET_NAME && call_name == Self::CALL_NAME
}
}
};
let client_fn = quote! {