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

signed extensions: metadata type generation using reflect #304

Merged
merged 19 commits into from
Dec 7, 2023

Conversation

nicksinch
Copy link
Contributor

@nicksinch nicksinch commented Nov 24, 2023

Detailed description:

  • Aims to remove the necessity of writing manually a Metadata() function for each signed extension
  • This is achieved using a dynamic map that stores the ids of metadata types which is initialized prior starting to build the metadata of the extrinsic
  • Metadata types are generated using reflect package when iterating recursively the extensions of the signedExtra type

Which issue(s) this PR fixes:
Fixes: part of #191

Checklist

  • Documentation added
  • Tests updated

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71d0279) 78.37% compared to head (587e380) 78.51%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #304      +/-   ##
===========================================
+ Coverage    78.37%   78.51%   +0.14%     
===========================================
  Files          159      159              
  Lines        10432    10500      +68     
===========================================
+ Hits          8176     8244      +68     
  Misses        1895     1895              
  Partials       361      361              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicksinch nicksinch force-pushed the metadata-reflect-private-map branch 2 times, most recently from 15db8f7 to dd8b88c Compare November 27, 2023 16:48
primitives/types/extra.go Outdated Show resolved Hide resolved
@failfmi failfmi linked an issue Dec 1, 2023 that may be closed by this pull request
@nicksinch nicksinch force-pushed the metadata-reflect-private-map branch from 85f0b8f to cd60918 Compare December 6, 2023 12:09
@nicksinch nicksinch force-pushed the metadata-reflect-private-map branch from cd60918 to c53cbb4 Compare December 6, 2023 12:49
Makefile Show resolved Hide resolved
api/metadata/module.go Outdated Show resolved Hide resolved
api/metadata/module.go Outdated Show resolved Hide resolved
execution/extrinsic/runtime_extrinsic_test.go Outdated Show resolved Hide resolved
primitives/types/extra_test.go Outdated Show resolved Hide resolved
@nicksinch nicksinch force-pushed the metadata-reflect-private-map branch from 8a6f123 to 4701748 Compare December 7, 2023 10:33
@failfmi failfmi self-requested a review December 7, 2023 12:27
@nicksinch nicksinch merged commit 48fe3a3 into develop Dec 7, 2023
5 checks passed
@nicksinch nicksinch deleted the metadata-reflect-private-map branch December 7, 2023 14:45
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.

research metadata using reflect
3 participants