Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Aug 16, 2023
1 parent c0974d8 commit 79b0e0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/world/src/modules/core/CoreModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ contract CoreModule is IModule, WorldContext {
value: 0,
funcSelectorAndArgs: abi.encodeWithSelector(
WorldRegistrationSystem.registerSystem.selector,
ROOT_NAMESPACE,
CORE_SYSTEM_NAME,
ResourceSelector.from(ROOT_NAMESPACE, CORE_SYSTEM_NAME),
coreSystem,
true
)
Expand Down
9 changes: 5 additions & 4 deletions packages/world/test/World.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ contract WorldTest is Test, GasReporter {

// Register a new system
bytes32 resourceSelector2 = ResourceSelector.from("namespace2", "name");
world.registerSystem(resourceSelector, new System(), false);
world.registerSystem(resourceSelector2, new System(), false);

// Expect an error when trying to register a table at the same selector
vm.expectRevert(abi.encodeWithSelector(IWorldErrors.ResourceExists.selector, resourceSelector.toString()));
vm.expectRevert(abi.encodeWithSelector(IWorldErrors.ResourceExists.selector, resourceSelector2.toString()));
world.registerTable(resourceSelector2, defaultKeySchema, Bool.getValueSchema(), new string[](1), new string[](1));
}

Expand Down Expand Up @@ -658,12 +658,13 @@ contract WorldTest is Test, GasReporter {
world.registerTable(tableId, defaultKeySchema, Bool.getValueSchema(), new string[](1), new string[](1));

// Register a new system
bytes32 systemId = ResourceSelector.from("namespace", "testSystem");
WorldTestSystem system = new WorldTestSystem();
world.registerSystem(tableId, system, false);
world.registerSystem(systemId, system, false);

// Call a system function that writes data to the World
world.call(
tableId,
systemId,
abi.encodeWithSelector(WorldTestSystem.writeData.selector, bytes16("namespace"), bytes16("testTable"), true)
);

Expand Down

0 comments on commit 79b0e0d

Please sign in to comment.