Skip to content

Commit

Permalink
refactor: hardcode key/value schema in table libraries (#2328)
Browse files Browse the repository at this point in the history
Co-authored-by: yonada <[email protected]>
  • Loading branch information
holic and yonadaaa authored Feb 28, 2024
1 parent 212aeea commit 3042f86
Show file tree
Hide file tree
Showing 80 changed files with 656 additions and 1,908 deletions.
16 changes: 16 additions & 0 deletions .changeset/tough-pumpkins-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"create-mud": patch
"@latticexyz/store": minor
"@latticexyz/world": minor
"@latticexyz/world-modules": minor
---

Moved key schema and value schema methods to constants in code-generated table libraries for less bytecode and less gas in register/install methods.

```diff
-console.log(SomeTable.getKeySchema());
+console.log(SomeTable._keySchema);

-console.log(SomeTable.getValueSchema());
+console.log(SomeTable._valueSchema);
```
40 changes: 8 additions & 32 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.

36 changes: 8 additions & 28 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.

35 changes: 8 additions & 27 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.

38 changes: 8 additions & 30 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.

35 changes: 8 additions & 27 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.

Loading

0 comments on commit 3042f86

Please sign in to comment.