-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(template_lib)!: new access rules macro #1176
feat(template_lib)!: new access rules macro #1176
Conversation
Test Results (CI)571 tests +1 570 ✅ +1 3h 15m 47s ⏱️ - 2m 28s For more details on these failures, see this check. Results for commit 352baae. ± Comparison against base commit 39c638b. ♻️ This comment has been updated with latest results. |
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.
Nice utACK
50e7b8c
Description
tari_template_lib
to buildAccessRule
enumsaccount
andaccount_nft
)Motivation and Context
We want a better way of constructing
AccessRules
. For example, to restrict a resource to be minted only by a specific component, we need something like:Instead, we want a new macro that allows us to build access rules in simpler and more readable way:
This PR adds a new macro rule! for this purpose. All variants of rules can be build as follows:
rule!(allow_all)
rule!(deny_all)
rule!(component(address))
rule!(resource(address))
rule!(template(address))
rule!(non_fungible(address))
rule!(any_of(component(c_address)), template(t_address)))
How Has This Been Tested?
What process can a PR reviewer use to test or verify this change?
See previous section
Breaking Changes
tari_template_lib
crate changes, all the builtin templates (e.g. account) also change.