Skip to content

Commit bdad072

Browse files
committed
remove world functions
1 parent 5de9cce commit bdad072

File tree

5 files changed

+15
-49
lines changed

5 files changed

+15
-49
lines changed

packages/world-module-batchstore/mud.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@ export default defineWorld({
66
// generate into experimental dir until these are stable/audited
77
systemLibrariesDirectory: "experimental/systems",
88
},
9+
systems: {
10+
BatchStoreSystem: {
11+
deploy: {
12+
disabled: true,
13+
registerWorldFunctions: false,
14+
},
15+
},
16+
},
917
});

packages/world-module-batchstore/src/BatchStoreModule.sol

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,8 @@ contract BatchStoreModule is Module {
1717
function installRoot(bytes memory encodedArgs) public override {
1818
ResourceId systemId = batchStoreSystem.toResourceId();
1919

20-
if (!ResourceIds.getExists(systemId)) {
21-
worldRegistrationSystem.callAsRoot().registerSystem(systemId, systemAddress, true);
22-
// TODO: since this is a scary/internal and use-with-caution module/system, should we not register function selectors?
23-
worldRegistrationSystem.callAsRoot().registerRootFunctionSelector(
24-
systemId,
25-
"getTableRecords(bytes32,bytes32[][])",
26-
"getTableRecords(bytes32,bytes32[][])"
27-
);
28-
worldRegistrationSystem.callAsRoot().registerRootFunctionSelector(
29-
systemId,
30-
"setTableRecords(bytes32,(bytes32[],bytes,bytes32,bytes)[])",
31-
"setTableRecords(bytes32,(bytes32[],bytes,bytes32,bytes)[])"
32-
);
33-
worldRegistrationSystem.callAsRoot().registerRootFunctionSelector(
34-
systemId,
35-
"deleteTableRecords(bytes32,bytes32[][])",
36-
"deleteTableRecords(bytes32,bytes32[][])"
37-
);
38-
} else if (batchStoreSystem.getAddress() != address(systemAddress)) {
39-
// upgrade system
20+
if (batchStoreSystem.getAddress() != address(systemAddress)) {
21+
// install or upgrade system
4022
worldRegistrationSystem.callAsRoot().registerSystem(systemId, systemAddress, true);
4123
}
4224
}

packages/world-module-batchstore/src/codegen/world/IBatchStoreSystem.sol

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/world-module-batchstore/src/codegen/world/IWorld.sol

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/world-module-batchstore/test/BatchStoreModule.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ contract BatchStoreModuleTest is Test, GasReporter {
4040
keys[0] = NamespaceOwner.encodeKeyTuple(WorldResourceIdLib.encodeNamespace(""));
4141

4242
startGasReport("get table records");
43-
world.getTableRecords(NamespaceOwner._tableId, keys);
43+
batchStoreSystem.getTableRecords(NamespaceOwner._tableId, keys);
4444
endGasReport();
4545

46-
TableRecord[] memory records = world.getTableRecords(NamespaceOwner._tableId, keys);
46+
TableRecord[] memory records = batchStoreSystem.getTableRecords(NamespaceOwner._tableId, keys);
4747
assertEq(records.length, 1);
4848
assertEq(records[0].keyTuple, keys[0]);
4949

@@ -73,7 +73,7 @@ contract BatchStoreModuleTest is Test, GasReporter {
7373
});
7474

7575
startGasReport("set table records");
76-
world.setTableRecords(NamespaceOwner._tableId, records);
76+
batchStoreSystem.setTableRecords(NamespaceOwner._tableId, records);
7777
endGasReport();
7878

7979
assertEq(NamespaceOwner.get(namespace), address(this));
@@ -91,7 +91,7 @@ contract BatchStoreModuleTest is Test, GasReporter {
9191
keys[0] = NamespaceOwner.encodeKeyTuple(namespace);
9292

9393
startGasReport("delete table records");
94-
world.deleteTableRecords(NamespaceOwner._tableId, keys);
94+
batchStoreSystem.deleteTableRecords(NamespaceOwner._tableId, keys);
9595
endGasReport();
9696

9797
assertEq(NamespaceOwner.get(namespace), address(0));

0 commit comments

Comments
 (0)