Skip to content

Commit

Permalink
refactor: signature is string
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa committed Mar 7, 2024
1 parent 9137a92 commit b5549d0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ contract WorldRegistrationSystem is System, IWorldErrors, LimitedCallContext {

// Compute global function selector
string memory namespaceString = WorldResourceIdLib.toTrimmedString(systemId.getNamespace());
bytes memory worldFunctionSignature = abi.encodePacked(namespaceString, "__", systemFunctionSignature);
worldFunctionSelector = bytes4(keccak256(worldFunctionSignature));
string memory worldFunctionSignature = string.concat(namespaceString, "__", systemFunctionSignature);
worldFunctionSelector = bytes4(keccak256(bytes(worldFunctionSignature)));

// Require the function selector to be globally unique
ResourceId existingSystemId = FunctionSelectors._getSystemId(worldFunctionSelector);
Expand All @@ -216,7 +216,7 @@ contract WorldRegistrationSystem is System, IWorldErrors, LimitedCallContext {

// Register the function signatures for offchain use
FunctionSignatures._set(systemFunctionSelector, systemFunctionSignature);
FunctionSignatures._set(worldFunctionSelector, string(worldFunctionSignature));
FunctionSignatures._set(worldFunctionSelector, worldFunctionSignature);
}

/**
Expand Down

0 comments on commit b5549d0

Please sign in to comment.