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

refactor: result types #322

Merged
merged 5 commits into from
Jan 9, 2024
Merged

refactor: result types #322

merged 5 commits into from
Jan 9, 2024

Conversation

tgntr
Copy link
Collaborator

@tgntr tgntr commented Dec 22, 2023

Detailed description:
Remove most result types from the codebase, as they are currently used to wrap the actual value types, which adds complexity and makes the code less readable. This is not needed in Go since it supports multiple return values. There are a few polkadot defined result types that can be encoded just before returning the final result.
Which issue(s) this PR fixes:
Fixes #298

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

@tgntr tgntr self-assigned this Dec 22, 2023
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (7ac3439) 80.55% compared to head (03dd40e) 80.85%.

Files Patch % Lines
frame/system/module.go 81.81% 3 Missing and 3 partials ⚠️
frame/balances/call_set_balance.go 78.57% 2 Missing and 1 partial ⚠️
frame/balances/genesis_builder.go 25.00% 2 Missing and 1 partial ⚠️
frame/balances/module.go 93.61% 0 Missing and 3 partials ⚠️
frame/balances/call_force_free.go 81.81% 1 Missing and 1 partial ⚠️
frame/balances/call_transfer.go 93.10% 1 Missing and 1 partial ⚠️
execution/types/checked_extrinsic.go 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #322      +/-   ##
===========================================
+ Coverage    80.55%   80.85%   +0.30%     
===========================================
  Files          165      163       -2     
  Lines        10841    10568     -273     
===========================================
- Hits          8733     8545     -188     
+ Misses        1798     1732      -66     
+ Partials       310      291      -19     

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

@tgntr tgntr linked an issue Dec 22, 2023 that may be closed by this pull request
Copy link
Collaborator

@radkomih radkomih left a comment

Choose a reason for hiding this comment

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

lgtm, only the tests coverage

frame/executive/executive.go Outdated Show resolved Hide resolved
@radkomih radkomih merged commit bd1ca39 into develop Jan 9, 2024
5 checks passed
@radkomih radkomih deleted the refactor/result-types branch January 9, 2024 07:53
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.

Remove error-wrapping Result types
3 participants