Skip to content

Commit

Permalink
add comment to explain where hex comes from
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Feb 2, 2024
1 parent b23ed83 commit 5b707f7
Show file tree
Hide file tree
Showing 46 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/Multi.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/Number.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/NumberList.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/Position.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/StaticArray.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/packages/contracts/src/codegen/tables/Vector.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/Dynamics1.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/Dynamics2.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/Offchain.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/Singleton.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/Statics.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/tables/UserTyped.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/common/src/codegen/render-solidity/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ export function renderTableId({
tableIdName,
}: Pick<StaticResourceData, "namespace" | "name" | "offchainOnly" | "tableIdName">): string {
return `
// Hex below is the result of \`WorldResourceIdLib.encode({ namespace: ${JSON.stringify(
namespace
)}, name: ${JSON.stringify(name)}, typeId: ${offchainOnly ? "RESOURCE_OFFCHAIN_TABLE" : "RESOURCE_TABLE"} });\`
ResourceId constant _tableId = ResourceId.wrap(${resourceToHex({
type: offchainOnly ? "offchainTable" : "table",
namespace,
Expand Down
1 change: 1 addition & 0 deletions packages/store/src/codegen/tables/ResourceIds.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/src/codegen/tables/StoreHooks.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/src/codegen/tables/Tables.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/test/codegen/tables/Callbacks.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/test/codegen/tables/KeyEncoding.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/test/codegen/tables/Mixed.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/store/test/codegen/tables/Vector2.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
// Import user types
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";

// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "KeysInTable", typeId: RESOURCE_TABLE });`
ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004b657973496e5461626c650000000000);
ResourceId constant KeysInTableTableId = _tableId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
// Import user types
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";

// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "UsedKeysIndex", typeId: RESOURCE_TABLE });`
ResourceId constant _tableId = ResourceId.wrap(0x74620000000000000000000000000000557365644b657973496e646578000000);
ResourceId constant UsedKeysIndexTableId = _tableId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
// Import user types
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";

// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "CallboundDelegat", typeId: RESOURCE_TABLE });`
ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000043616c6c626f756e6444656c65676174);
ResourceId constant CallboundDelegationsTableId = _tableId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
// Import user types
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";

// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "SystemboundDeleg", typeId: RESOURCE_TABLE });`
ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000053797374656d626f756e6444656c6567);
ResourceId constant SystemboundDelegationsTableId = _tableId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Schema, SchemaLib } from "@latticexyz/store/src/Schema.sol";
import { PackedCounter, PackedCounterLib } from "@latticexyz/store/src/PackedCounter.sol";
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";

// Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "TimeboundDelegat", typeId: RESOURCE_TABLE });`
ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000054696d65626f756e6444656c65676174);
ResourceId constant TimeboundDelegationsTableId = _tableId;

Expand Down
1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/Balances.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/FunctionSelectors.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/FunctionSignatures.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/InitModuleAddress.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/InstalledModules.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/NamespaceOwner.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/ResourceAccess.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/SystemHooks.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/world/src/codegen/tables/SystemRegistry.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5b707f7

Please sign in to comment.