Skip to content

Commit

Permalink
feat: new layout support (#1970)
Browse files Browse the repository at this point in the history
* Use name hash for model identifiers

* Dojo layout rework

* support nested tuple/array/bytearray

* new Layout::Enum to support enum with different variant data

* merge from storage-layout branch

* cleaning

* support direct array/span introspect instead of generating it during code compilation

* fix Copy trait implementation for Array<u64>

* generate the model/field selector value instead of selector!(...)

* feat: start implementing new layout on torii wip

* update: cainome for serde & serialize layout

* feat: handle bytearray in ty

* feat: add new layout types (tuple/array/bytearray) to types & grpc

* fix: gql

* fix: model id for processors

* featr: start handling sql new tytpes

* feat: make tuple and bytearray work

* feat: store set record for tuples

* feat: start working on array

* feat: set support for bytearray & tuples

* feat: primitive arrays working

* feat: complex array types

* feat: start work on graphql for arrays

* fix: tuples for graphql

* fix: sanitize member type names gql

* feat: remove tuple from scalar types

* chore: fetch row by idx

* feat: add new type data for array

* feat: add updated_at for entity models data

* feat: start handle array type datalogic

* refactor: use list typedata

* refactor: modela data recursive

* feat: get list with new type data correctly

* feat: finished array support with nested types ✨

* fix: schema

* feat: torii packing

* integrates scarb nightly (#1971)

wip with scarb nightly

* fix: fmt + regenerate world bindings

* fix: remove serialization workaround

* fix: remove cairo warnings for build

* Storage layout improvement (#1965)

* Finalize the storage layout rework

- As the type recursion issue was fixed by Starkware, Layout/FieldLayout
  can be simplified.
- Update introspect size() and ty() methods
- Remove old model layout parsing in model.rs
- Split and reorganize introspect.rs code

* fix fmt+clippy

* update ABI binding

* fix cairo fmt

* feat: new parse schema function using cainome for model

* feat: complex enum supported ✨

* chore: bump blockifier and patch deps to use scarb nightly

* fix: run CAIRO_FIX tests and rebuild artifacts

* fix: use Tricks for dojo language server

* fix: remove async for language server

* wip: fix tests

* feat: add union type data for enums

* feat: continue work on type unions for enums

* feat: refactor complex enums

* feat: completely switch to using nested types for enums

* fmt

* clippy

* chore

* Automatically add Introspect derive attribute for Dojo models (#1982)

* Automatically add Introspect derive attribute for Dojo models

* fix fmt+clippy

* fix warning about trait path in Impl

* update dojo-lang tests

* fix dojo-lang system

* fix dojo-world model test

* fix option<T> introspect

* fix: ensure all models are correctly derived

---------

Co-authored-by: glihm <[email protected]>

* fix: adjust tests with missing model

* wip: auth tests debug

* fix: ensure auth is using selector

* fix: fix some tests

* fix: models tests enum

* fix: other tests

* chore: tuple for u256

* refactor: u256 struct

* feat: simple enum types non nested + fix texts

* fmt

* fix: filtering by enum type name

* chore: clippy

* fmt

* fix: sql test

* refactor: packed size in tests &  simply functions

* fix: switch back u256 to primitive

* feat: use correct primitive u256 type & filtering

* wip

* chore: subscription test

* migration clippy

* wip

* feat: add new example with more types

* fix: strip enum variant type inf

* fix: nested tuples

* chore

* chore: remove debug logs

* fix: fix tests with new model

* fix: add missing manifests

* fix: fix cairo fmt

* fix: arrays

* fix: add tests and enhance error messages

* fix: fix build test and disable typescript for now

* fix: avoid race on manifest file for sql test

* feat: refactor schema deser from db & handle nested arrays

* chore: delete array elements on update

* fmt

* feat: add sozo prefix parsing for calldata

* fix: ensure migration for sql test waits for transactions

* fix: ensure build test works on a copy project

* fix: add missing transaction wait

* temp-fix: arrays

---------

Co-authored-by: Tarrence van As <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: glihm <[email protected]>
  • Loading branch information
4 people authored May 23, 2024
1 parent 3b71225 commit e614651
Show file tree
Hide file tree
Showing 138 changed files with 18,462 additions and 5,559 deletions.
59 changes: 39 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in 'dojo-world'",
"cargo": {
"args": ["test", "--no-run", "--package=dojo-world", "--lib"],
"filter": {
"name": "dojo-world",
"kind": "lib"
}
},
"args": ["migration::compile_moves"],
"cwd": "${workspaceFolder}/crates/dojo-world"
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Dojo Core test",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/sozo",
"args": ["--manifest-path", "crates/dojo-core/Scarb.toml", "test"]
},
{
"name": "Sozo Migrate",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/target/debug/sozo",
"args": [
"--manifest-path",
"examples/spawn-and-move/Scarb.toml",
"migrate",
"apply"
]
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in 'dojo-world'",
"cargo": {
"args": ["test", "--no-run", "--package=dojo-world", "--lib"],
"filter": {
"name": "dojo-world",
"kind": "lib"
}
},
"args": ["migration::compile_moves"],
"cwd": "${workspaceFolder}/crates/dojo-world"
}
]
}
Loading

0 comments on commit e614651

Please sign in to comment.