Skip to content

Commit

Permalink
Renamed AccessRuleNode in test blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrug-rdx committed Jun 6, 2024
1 parent dee74b5 commit 5c0f675
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ mod swappy {
#[blueprint]
mod count_of_zero {
enable_function_auth! {
hi => AccessRule::Protected(AccessRuleNode::ProofRule(ProofRule::CountOf(0, vec![ResourceOrNonFungible::Resource(XRD)])));
hi => AccessRule::Protected(CompositeRequirement::BasicRequirement(ExplicitRequirement::CountOf(0, vec![ResourceOrNonFungible::Resource(XRD)])));
}

struct CountOfZero {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ fn generate_deep_access_rules(
resource_address: ResourceAddress,
exceed_depth: usize,
) -> RoleAssignmentInit {
let mut access_rule_node = AccessRuleNode::ProofRule(ProofRule::Require(
let mut composite_requirement = CompositeRequirement::BasicRequirement(ExplicitRequirement::Require(
ResourceOrNonFungible::Resource(resource_address),
));
let mut curr_depth = 6; // The inner bit and the outer mapping
while curr_depth < exceed_depth {
access_rule_node = AccessRuleNode::AllOf(vec![access_rule_node]);
composite_requirement = CompositeRequirement::AllOf(vec![composite_requirement]);
curr_depth += 2;
}

roles2! {
"test" => AccessRule::Protected(access_rule_node.clone()), updatable;
"test" => AccessRule::Protected(composite_requirement.clone()), updatable;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ fn generate_deep_access_rules(
resource_address: ResourceAddress,
exceed_depth: usize,
) -> RoleAssignmentInit {
let mut access_rule_node = AccessRuleNode::ProofRule(ProofRule::Require(
let mut composite_requirement = CompositeRequirement::BasicRequirement(ExplicitRequirement::Require(
ResourceOrNonFungible::Resource(resource_address),
));
let mut curr_depth = 6; // The inner bit and the outer mapping
while curr_depth < exceed_depth {
access_rule_node = AccessRuleNode::AllOf(vec![access_rule_node]);
composite_requirement = CompositeRequirement::AllOf(vec![composite_requirement]);
curr_depth += 2;
}

roles2! {
"test" => AccessRule::Protected(access_rule_node.clone()), updatable;
"test" => AccessRule::Protected(composite_requirement.clone()), updatable;
}
}

0 comments on commit 5c0f675

Please sign in to comment.