🎨 Macros update and documentation#483
Merged
Merged
Conversation
Member
Author
1ec8417 to
c76355c
Compare
86ad07e to
382f61e
Compare
This was referenced May 8, 2025
382f61e to
91611a0
Compare
This was referenced May 9, 2025
Merged
There was a problem hiding this comment.
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
Closed
26a2f51 to
65f2ce3
Compare
5abd90d to
14b0f58
Compare
14b0f58 to
2fa24d7
Compare
2fa24d7 to
60e9f36
Compare
b37298c to
65f2ce3
Compare
dastansam
approved these changes
Jul 28, 2025
| // 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] |
Contributor
There was a problem hiding this comment.
Suggested change
| #[macro_export] |
doesn't need to be exported? (not sure if it works though)
Member
Author
60e9f36 to
45a3925
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.