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

Hygienic procedure macros #65

Merged
merged 4 commits into from
Sep 21, 2022
Merged

Hygienic procedure macros #65

merged 4 commits into from
Sep 21, 2022

Conversation

vmarkushin
Copy link

@vmarkushin vmarkushin commented Sep 20, 2022

closes #62

@vmarkushin vmarkushin added the enhancement New feature or request label Sep 20, 2022
@vmarkushin vmarkushin self-assigned this Sep 20, 2022
Copy link

@Wizdave97 Wizdave97 left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -231,18 +256,18 @@ impl State {
});

quote! {
fn verify_client_consensus_state<Ctx: ReaderContext>(
fn verify_client_consensus_state<Ctx: #crate_::core::ics26_routing::context::ReaderContext>(

Choose a reason for hiding this comment

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

This isn't going to work for downstream crates, it should be

::ibc::core::ics26_routing::context::ReaderContext

Copy link
Author

Choose a reason for hiding this comment

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

crate_ here is an identifier of the ibc crate defined by the user so that it will work (or crate keyword in case of using the macro in the ibc crate in mocks). The only difference is that there is no prepending ::, I'll add it

Choose a reason for hiding this comment

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

ok didn't know that, great thinking

@seunlanlege seunlanlege merged commit 050c648 into master Sep 21, 2022
@seunlanlege seunlanlege deleted the hygienic-macros branch September 21, 2022 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hygenic proc macros in ibc-derive
3 participants