Skip to content

Commit

Permalink
Update aptos-move/framework/aptos-framework/sources/permissioned_sign…
Browse files Browse the repository at this point in the history
…er.move

Co-authored-by: Aaron <[email protected]>
  • Loading branch information
runtian-zhou and lightmark committed Jan 15, 2025
1 parent da38949 commit f928323
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ module aptos_framework::permissioned_signer {
/// check if StoredPermission has at least `threshold` capacity.
fun is_above(perm: &StoredPermission, threshold: u256): bool {
match (perm) {
StoredPermission::Capacity(capacity) => *capacity > threshold,
StoredPermission::Capacity(capacity) => *capacity >= threshold,
StoredPermission::Unlimited => true,
}
}
Expand Down Expand Up @@ -491,7 +491,8 @@ module aptos_framework::permissioned_signer {
public(package) fun check_permission_exists<PermKey: copy + drop + store>(
s: &signer, perm: PermKey
): bool acquires PermissionStorage {
check_permission_capacity_above(s, 0, perm)
// 0 capacity permissions will be treated as non-existant.
check_permission_capacity_above(s, 1, perm)
}

public(package) fun check_permission_capacity_above<PermKey: copy + drop + store>(
Expand Down

0 comments on commit f928323

Please sign in to comment.