mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 01:47:55 +00:00
Add hooks to register event types for decoding (#227)
* Global registration of type segmenters for event decoding * Perform type sizes check when building client * Introduce EventTypeRegistry for global runtime type sizes * Fmt * Register runtime type sizes on creation of EventTypeRegistry * Register more default dispatch types * Add missing type sizes * fmt * Fix up register_type_size builder method * Update doc comments * Make register_default_type_sizes public * Don't allow duplicate registered types * Remove call to supertraits type registration, done manually in Runtime * Fix tests and warnings * Fix duplicate type registration * Fmt * review: use is_empty() Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * Add panic docs Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
@@ -57,6 +57,13 @@ pub enum Error {
|
||||
/// Metadata error.
|
||||
#[error("Metadata error: {0}")]
|
||||
Metadata(#[from] MetadataError),
|
||||
/// Unregistered type sizes.
|
||||
#[error(
|
||||
"The following types do not have a type size registered: \
|
||||
{0:?} \
|
||||
Use `ClientBuilder::register_type_size` to register missing type sizes."
|
||||
)]
|
||||
MissingTypeSizes(Vec<String>),
|
||||
/// Type size unavailable.
|
||||
#[error("Type size unavailable while decoding event: {0:?}")]
|
||||
TypeSizeUnavailable(String),
|
||||
|
||||
Reference in New Issue
Block a user