mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 11:27:58 +00:00
Obtain DispatchError::Module info dynamically (#453)
* Add error information back into metadata to roll back removal in #394 * Go back to obtaining runtime error info * re-do codegen too to check that it's all gravy * Convert DispatchError module errors into a module variant to make them easier to work with * Fix broken doc link
This commit is contained in:
@@ -265,9 +265,8 @@ impl RuntimeGenerator {
|
||||
pallet.calls.as_ref().map(|_| pallet_mod_name)
|
||||
});
|
||||
|
||||
let error_details = errors::generate_error_details(&self.metadata);
|
||||
let error_type = error_details.type_def;
|
||||
let error_fn = error_details.dispatch_error_impl_fn;
|
||||
let has_module_error_impl =
|
||||
errors::generate_has_module_error_impl(&self.metadata, types_mod_ident);
|
||||
|
||||
let default_account_data_ident = format_ident!("DefaultAccountData");
|
||||
let default_account_data_impl = generate_default_account_data_impl(
|
||||
@@ -291,12 +290,8 @@ impl RuntimeGenerator {
|
||||
|
||||
/// The default error type returned when there is a runtime issue.
|
||||
pub type DispatchError = #types_mod_ident::sp_runtime::DispatchError;
|
||||
|
||||
// Statically generate error information so that we don't need runtime metadata for it.
|
||||
#error_type
|
||||
impl DispatchError {
|
||||
#error_fn
|
||||
}
|
||||
// Impl HasModuleError on DispatchError so we can pluck out module error details.
|
||||
#has_module_error_impl
|
||||
|
||||
#default_account_data_impl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user