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

Need to rewrite defensive! macro to be compatible with umbrella crate #7054

Closed
Krayt78 opened this issue Jan 6, 2025 · 7 comments
Closed
Labels
I4-refactor Code needs refactoring.

Comments

@Krayt78
Copy link
Contributor

Krayt78 commented Jan 6, 2025

As seen during pallet migrations in here : #6504

The current implementation of the defensive! macro is dependent on having frame_support as seen here : https://paritytech.github.io/polkadot-sdk/master/src/frame_support/traits/misc.rs.html#67-95

We need to change this dependency to be compatible with umbrella crate

@gui1117
Copy link
Contributor

gui1117 commented Jan 7, 2025

Isn't it possible to just replace frame_support with $crate in the macro?

@Krayt78
Copy link
Contributor Author

Krayt78 commented Jan 7, 2025

Isn't it possible to just replace frame_support with $crate in the macro?

should do the trick yeah

@Krayt78
Copy link
Contributor Author

Krayt78 commented Jan 7, 2025

The PR for this is in here #7069

@seemantaggarwal
Copy link

Hey, I already made the changes as part of my commit here: https://github.com/paritytech/polkadot-sdk/pull/7048/commits I will merge mine soon, you can discard this issue, or update with my commit

@Krayt78
Copy link
Contributor Author

Krayt78 commented Jan 7, 2025

Hey, I already made the changes as part of my commit here: https://github.com/paritytech/polkadot-sdk/pull/7048/commits I will merge mine soon, you can discard this issue, or update with my commit

Wouldnt it be better to have a seperate PR for this ? just in case we need to revert it and it would be faster to merge

@re-gius
Copy link
Contributor

re-gius commented Jan 7, 2025

I'm merging #7069 since it's already ready to merge and could unblock other PRs + easy to revert

github-merge-queue bot pushed a commit that referenced this issue Jan 7, 2025
PR for #7054 

Replaced frame_support with $crate from @gui1117 's suggestion to fix
the dependency issue

---------

Co-authored-by: command-bot <>
@re-gius
Copy link
Contributor

re-gius commented Jan 7, 2025

closed by #7069

@re-gius re-gius closed this as completed Jan 7, 2025
@re-gius re-gius added the I4-refactor Code needs refactoring. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I4-refactor Code needs refactoring.
Projects
None yet
Development

No branches or pull requests

4 participants