Skip to content

Commit

Permalink
use new namespace check in unregisterNamespaceDelegation
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Jan 18, 2024
1 parent 73b5ded commit 4659afa
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract WorldRegistrationSystem is System, IWorldErrors {
* @param namespaceId The unique identifier for the new namespace
*/
function registerNamespace(ResourceId namespaceId) public virtual {
// Require namespace to be a valid namespace ID
// Require namespace ID to be a valid namespace
requireNamespace(namespaceId);

// Require namespace to not exist yet
Expand Down Expand Up @@ -330,7 +330,7 @@ contract WorldRegistrationSystem is System, IWorldErrors {
ResourceId delegationControlId,
bytes memory initCallData
) public {
// Require namespace to be a valid namespace ID
// Require namespace ID to be a valid namespace
requireNamespace(namespaceId);

// Require the delegation to not be unlimited
Expand Down Expand Up @@ -365,10 +365,8 @@ contract WorldRegistrationSystem is System, IWorldErrors {
* @param namespaceId The ID of the namespace
*/
function unregisterNamespaceDelegation(ResourceId namespaceId) public {
// Require the namespaceId to be a valid namespace ID
if (namespaceId.getType() != RESOURCE_NAMESPACE) {
revert World_InvalidResourceType(RESOURCE_NAMESPACE, namespaceId, namespaceId.toString());
}
// Require namespace ID to be a valid namespace
requireNamespace(namespaceId);

// Require the caller to own the namespace
AccessControl.requireOwner(namespaceId, _msgSender());
Expand Down

0 comments on commit 4659afa

Please sign in to comment.