Skip to content

Allow for static event decoding #28

@geigerzaehler

Description

@geigerzaehler

At the moment events from ExtrinsicSuccess are encoded in the RuntimeEvents struct. The RuntimeEvents struct has no relation to the runtime types. It would be preferable to instead decode the events as the real event type obtained from the runtime. More concretely

pub struct ExtrinsicSuccess<T: System> {
  // ...
  events: srml_system::EventRecord<T::Event, T::Hash>
}

This would require us to add the associated Event type to the System trait.

With this implementation we could do away with the dynamic event parsing which suffers from a couple of issues.

  • It needs to fetch the metadata
  • It requires substantial manual decoding logic for events
  • It requires registering type sizes for custom structs.

I’d be willing to give this a stab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions