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

Chain Extension: Evaluation of method return type at compile time #1569

Merged
merged 13 commits into from
Jan 24, 2023

Conversation

SkymanOne
Copy link
Contributor

@SkymanOne SkymanOne commented Dec 24, 2022

This PR closes #952

It introduces breaking changes to chain extension macro API: returns_result flag has been removed
Since this PR, Result<O, E> return type is detected and handled at the compile time.

If handle_status is set to true, the return type will still be wrapped into Result as before.

Tasks:

  • Code cleanup
  • Docs

@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2022

Codecov Report

Merging #1569 (3edee36) into master (8321e6f) will increase coverage by 6.85%.
The diff coverage is 41.66%.

❗ Current head 3edee36 differs from pull request most recent head 1a40267. Consider uploading reports for the commit 1a40267 to get more accurate results

@@            Coverage Diff             @@
##           master    #1569      +/-   ##
==========================================
+ Coverage   64.68%   71.53%   +6.85%     
==========================================
  Files         207      205       -2     
  Lines        6417     6268     -149     
==========================================
+ Hits         4151     4484     +333     
+ Misses       2266     1784     -482     
Impacted Files Coverage Δ
crates/env/src/chain_extension.rs 0.00% <0.00%> (ø)
crates/ink/ir/src/ir/attrs.rs 82.08% <ø> (+3.68%) ⬆️
crates/ink/macro/src/lib.rs 100.00% <ø> (ø)
crates/ink/tests/ui/chain_extension/E-01-simple.rs 3.12% <ø> (ø)
...rates/ink/codegen/src/generator/chain_extension.rs 95.23% <100.00%> (-0.51%) ⬇️
crates/ink/ir/src/ir/chain_extension.rs 93.33% <100.00%> (+22.74%) ⬆️
crates/env/src/call/create_builder.rs 0.00% <0.00%> (-2.64%) ⬇️
crates/allocator/src/bump.rs 88.23% <0.00%> (-0.85%) ⬇️
crates/e2e/src/xts.rs 0.00% <0.00%> (ø)
crates/e2e/src/client.rs 36.36% <0.00%> (ø)
... and 39 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@SkymanOne SkymanOne marked this pull request as ready for review December 26, 2022 13:58
Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

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

Not a fan of the > 80 CPL, but I see the surrounding code is using it too.

@cmichi cmichi merged commit 178a52f into master Jan 24, 2023
@cmichi cmichi deleted the gn/ce-use-result-macro branch January 24, 2023 21:55
@HCastano HCastano mentioned this pull request Jan 24, 2023
@ascjones ascjones mentioned this pull request Feb 15, 2023
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.

Follow-up #665: Make ink! chain extensions use is_result_type! utility macro
3 participants