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

Add Encode Decode to ExtrsinicReport and use RawExtrinsicDetails #704

Merged
merged 13 commits into from
Feb 19, 2024

Conversation

haerdib
Copy link
Contributor

@haerdib haerdib commented Feb 1, 2024

  • Removed Pointer and usize from EventDetails as they do not implement codec Decoding / Encoding.
  • Added RawEventDetails to allow usage of EventDetails without always holding the full metadata
  • Changed ExtrinsicReport to use RawEventDetails instead, to make the report smaller. Otherwise, the full metadata would get encoded / decode and moved all the time. I'd rather keep the report small. If needed, one can always transform the RawEventDetails back to EventDetails

closes #397

@haerdib haerdib self-assigned this Feb 1, 2024
@haerdib haerdib changed the title Add Encode Decode to RawExtrinsicDetails Add Encode Decode to RawEventDetails Feb 1, 2024
@haerdib haerdib changed the title Add Encode Decode to RawEventDetails Add Encode Decode to ExtrsinicReport and use RawExtrinsicDetails Feb 1, 2024
@haerdib haerdib marked this pull request as ready for review February 1, 2024 13:14
@haerdib haerdib added F6-optimization This should optimize the performance E2-breaksapi F7-enhancement Enhances an already existing functionality and removed F6-optimization This should optimize the performance labels Feb 1, 2024
@haerdib haerdib requested a review from masapr February 1, 2024 13:15
remove error changes and fix build

clean up

add transforming functions

remove non-consuming function

add comment

add encode decode to extrinsicreport

impl same functions for both event details and raw event details

fix lifetime

add metadata check

fix clippy

use raw events in extrinsic report

fix tests

one more fix :)
Copy link
Collaborator

@masapr masapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the reason for this change, is that we want to support serialization/deserialization, I would add a test for that. Then we know this capability will not be removed without a failing test.

Apart from that it looks good to me

@haerdib haerdib requested a review from masapr February 15, 2024 07:35
src/api/mod.rs Show resolved Hide resolved
node-api/src/events/raw_event_details.rs Show resolved Hide resolved
@haerdib haerdib requested a review from masapr February 15, 2024 15:11
Copy link
Collaborator

@masapr masapr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our discussion, I'd say it's good now

@haerdib haerdib merged commit 2508df1 into master Feb 19, 2024
54 checks passed
@haerdib haerdib deleted the bh/397-add-encode branch February 19, 2024 08:13
This was referenced Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2-breaksapi F7-enhancement Enhances an already existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Encode / Decode to ExtrinsicReport
2 participants