-
Notifications
You must be signed in to change notification settings - Fork 9
🎨 Macros update and documentation #483
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
Conversation
1ec8417 to
c76355c
Compare
86ad07e to
382f61e
Compare
382f61e to
91611a0
Compare
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.
Pull Request Overview
This PR updates macros in the funding instantiator to improve runtime event assertions and introduce new functionality.
- Enhances the assert_close_enough! macro with clearer intermediate variables and a unified edge-case handling.
- Adds the new is_close_enough! macro for boolean checks based on closeness.
- Overhauls the find_event! macro to support advanced event filtering with field checks.
c76355c to
c66702c
Compare
6c2a7dd to
eb49fc8
Compare
c66702c to
26a2f51
Compare
eb49fc8 to
5abd90d
Compare
26a2f51 to
65f2ce3
Compare
5abd90d to
14b0f58
Compare
14b0f58 to
2fa24d7
Compare
2fa24d7 to
60e9f36
Compare
b37298c to
65f2ce3
Compare
| // You should have received a copy of the GNU General Public License | ||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| #[macro_export] |
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.
| #[macro_export] |
doesn't need to be exported? (not sure if it works though)
60e9f36 to
45a3925
Compare

This pull request introduces significant improvements and new features to macros in the
pallets/funding/src/instantiator/macros.rsfile. The changes include enhancements to theassert_close_enough!macro, the addition of a newis_close_enough!macro, and a comprehensive overhaul of thefind_event!macro to support more advanced use cases. These updates improve functionality, readability, and flexibility when working with runtime events and assertions in the Substrate framework.Enhancements to
assert_close_enough!macro:Perquintill::one()is returned in such scenarios.Addition of
is_close_enough!macro:is_close_enough!to check if two values are close enough based on a minimum percentage, returning a boolean instead of asserting.assert_close_enough!for consistency.