mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-30 23:37:24 +00:00
expose module errors into metadata (#3752)
* expose module errors into metadata * it checks * Tests for error metadata * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * remove inherent errors from metadata * bump version * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update srml/support/src/error.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
38a61861b1
commit
2c77262c8f
@@ -23,7 +23,7 @@ pub use std::fmt;
|
||||
pub use crate::codec::{Codec, EncodeLike, Decode, Encode, Input, Output, HasCompact, EncodeAsRef};
|
||||
pub use srml_metadata::{
|
||||
FunctionMetadata, DecodeDifferent, DecodeDifferentArray, FunctionArgumentMetadata,
|
||||
ModuleConstantMetadata, DefaultByte, DefaultByteGetter,
|
||||
ModuleConstantMetadata, DefaultByte, DefaultByteGetter, ModuleErrorMetadata, ErrorMetadata
|
||||
};
|
||||
pub use sr_primitives::{
|
||||
weights::{
|
||||
@@ -1298,6 +1298,14 @@ macro_rules! decl_module {
|
||||
{ $( $other_where_bounds )* }
|
||||
$( $constants )*
|
||||
}
|
||||
|
||||
impl<$trait_instance: $trait_name $(<I>, $instance: $instantiable)?> $crate::dispatch::ModuleErrorMetadata
|
||||
for $mod_type<$trait_instance $(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn metadata() -> &'static [$crate::dispatch::ErrorMetadata] {
|
||||
<$error_type as $crate::dispatch::ModuleErrorMetadata>::metadata()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user