diff --git a/packages/common/src/hexToResourceId.test.ts b/packages/common/src/hexToResourceId.test.ts index 28ae646a03..56ebfecfdb 100644 --- a/packages/common/src/hexToResourceId.test.ts +++ b/packages/common/src/hexToResourceId.test.ts @@ -4,8 +4,8 @@ import { hexToResourceId } from "./hexToResourceId"; describe("hexToResourceId", () => { it("can convert from hex string", () => { const resourceId = hexToResourceId("0x74626e616d65737061636500000000006e616d65000000000000000000000000"); + expect(resourceId.type).toMatchInlineSnapshot('"table"'); expect(resourceId.namespace).toMatchInlineSnapshot('"namespace"'); expect(resourceId.name).toMatchInlineSnapshot('"name"'); - expect(resourceId.type).toMatchInlineSnapshot('"table"'); }); }); diff --git a/packages/common/src/hexToResourceId.ts b/packages/common/src/hexToResourceId.ts index b2bce87dfd..2f45ac2c17 100644 --- a/packages/common/src/hexToResourceId.ts +++ b/packages/common/src/hexToResourceId.ts @@ -18,13 +18,13 @@ function getResourceType(resourceTypeId: string): ResourceType | undefined { export function hexToResourceId(hex: Hex): ResourceId { const resourceTypeId = hexToString(sliceHex(hex, 0, 2)).replace(/\0+$/, ""); + const type = getResourceType(resourceTypeId); const namespace = hexToString(sliceHex(hex, 2, 16)).replace(/\0+$/, ""); const name = hexToString(sliceHex(hex, 16, 32)).replace(/\0+$/, ""); - const type = getResourceType(resourceTypeId); if (!type) { throw new Error(`Unknown resource type: ${resourceTypeId}`); } - return { namespace, name, type }; + return { type, namespace, name }; } diff --git a/packages/world/src/interfaces/IModule.sol b/packages/world/src/interfaces/IModule.sol index 407cbd51de..8a79abd7db 100644 --- a/packages/world/src/interfaces/IModule.sol +++ b/packages/world/src/interfaces/IModule.sol @@ -10,7 +10,6 @@ bytes4 constant MODULE_INTERFACE_ID = IModule.getName.selector ^ ERC165_INTERFACE_ID; interface IModule is IERC165 { - error RequiredModuleNotFound(string moduleIdString); error RootInstallModeNotSupported(); error NonRootInstallNotSupported();