Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Rewrite impl_runtime_apis! and decl_runtime_apis! as proc-macro #1174

Merged
merged 26 commits into from
Nov 30, 2018

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Nov 28, 2018

This is a complete rewrite of both macros as proc-macros.
Using proc-macro brings us certain advantages, like better error reporting and a more readable implementation.

@bkchr bkchr requested a review from gavofyork November 28, 2018 16:30
@rphmeier rphmeier added the A0-please_review Pull request needs code review. label Nov 28, 2018
Copy link
Contributor

@gnunicorn gnunicorn left a comment

Choose a reason for hiding this comment

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

Great Work. It is pretty mind-bending to review in between, but it looks pretty sound to me. Just some minor changes requested.

core/sr-api-macros/src/compile_fail_tests.rs Outdated Show resolved Hide resolved
core/sr-api-macros/src/compile_fail_tests.rs Outdated Show resolved Hide resolved
core/sr-api-macros/src/impl_runtime_apis.rs Outdated Show resolved Hide resolved
core/sr-api-macros/src/lib.rs Outdated Show resolved Hide resolved
core/sr-api-macros/src/lib.rs Outdated Show resolved Hide resolved
core/sr-api-macros/src/utils.rs Outdated Show resolved Hide resolved
core/sr-api-macros/tests/decl_and_impl.rs Outdated Show resolved Hide resolved
core/sr-api-macros/tests/decl_and_impl.rs Outdated Show resolved Hide resolved
core/sr-api-macros/tests/decl_and_impl.rs Show resolved Hide resolved
fn inherent_extrinsics(data: runtime_primitives::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
let mut inherent = Vec::new();

inherent.extend(
Copy link
Member

Choose a reason for hiding this comment

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

manual amalgamation code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I reverted in parts my macro here. I ran into some problems. As I will need to revisit the InherentData stuff anyway, I did not wanted to waste too much time on this topic in this pr.

@gavofyork gavofyork merged commit 5651ac7 into master Nov 30, 2018
@gavofyork gavofyork deleted the bkchr-runtime-api-v3 branch November 30, 2018 10:42
liuchengxu pushed a commit to liuchengxu/substrate that referenced this pull request May 31, 2023
Temporary banning for unreachable peers
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants