-
Notifications
You must be signed in to change notification settings - Fork 354
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
Added entry_points!
macro to reduce boilerplate when writing contracts
#437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Can you update MIGRATING.md and make a PR on cosmwasm-template
with this change? (Actually we need a whole 0.9 branch there, so maybe the comswasm-template stuff can come later)
Sooo... Should I do any of those things or not? |
No, thanks. I'll take care of that. |
I wrote this macro to allow us to reduce boilerplate when writing our own contracts, and figured it would be a good idea to suggest it upstream.
It's not the most flexible macro ever (and trust me, I know how to make macros flexible) but i had trouble taking the paths to the implementation functions or even just to the contract module itself in a flexible way because of a weird limitation of macro rules.
I added a doc-comment to the macro definition, and replaced the boilerplate in the example contracts to showcase the macro.
To illustrate, hackatom's
lib.rs
file now looks like this:Update: looks like I can't always require migrate to exist. I'll try to make that work.
Update: Done.