Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v15: Rename error_enum_ty to module_error_enum_ty #60

Merged
merged 5 commits into from
Jun 13, 2023
Merged

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Jun 7, 2023

This PR renames the error_enum_ty to better reflect the type details.

Considering that it does not represent the DispatchError emitted by the chain,
it contains only the information needed to decode the ModuleError of the
DispatchError::Module variant.

The ModuleError is represented by a raw form in sp-runtime:

pub struct ModuleError {
    pub index: [u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html),
    pub error: [[u8](https://doc.rust-lang.org/nightly/std/primitive.u8.html); [4](https://doc.rust-lang.org/nightly/std/primitive.array.html)],
    pub message: [Option](https://doc.rust-lang.org/nightly/core/option/enum.Option.html)<&'static [str](https://doc.rust-lang.org/nightly/std/primitive.str.html)>,
}

This added type in the metadata will provide support for better decoding of the module error:

enum ModuleErrorType {
   System(pallet_system::Error),
   ...
}

Needed by: paritytech/substrate#14143

// @paritytech/subxt-team

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Jun 7, 2023
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
frame-metadata/src/v15.rs Outdated Show resolved Hide resolved
Co-authored-by: James Wilson <james@jsdw.me>
frame-metadata/src/v15.rs Outdated Show resolved Hide resolved
lexnv and others added 2 commits June 7, 2023 18:31
Co-authored-by: James Wilson <james@jsdw.me>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv merged commit 426ba93 into main Jun 13, 2023
@lexnv lexnv deleted the lexnv/rename_error_ty branch June 13, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants