Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
remybar committed Nov 27, 2024
1 parent bc50d9e commit 590b2ee
Show file tree
Hide file tree
Showing 93 changed files with 9,337 additions and 86 deletions.
76 changes: 56 additions & 20 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ members = [
"bin/torii",
"crates/dojo/bindgen",
"crates/dojo/core",
# TODO: to be removed but still used by some tools like LS
"crates/dojo/lang",
"crates/dojo/macros",
"crates/dojo/test-utils",
"crates/dojo/types",
"crates/dojo/utils",
Expand Down Expand Up @@ -77,7 +79,7 @@ dojo-metrics = { path = "crates/metrics" }
# dojo-lang
dojo-bindgen = { path = "crates/dojo/bindgen" }
dojo-core = { path = "crates/dojo/core" }
dojo-lang = { path = "crates/dojo/lang" }
dojo-macros = { path = "crates/dojo/macros" }
dojo-test-utils = { path = "crates/dojo/test-utils" }
dojo-types = { path = "crates/dojo/types" }
dojo-world = { path = "crates/dojo/world" }
Expand Down
2 changes: 1 addition & 1 deletion bin/dojo-language-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ version.workspace = true
[dependencies]
cairo-lang-language-server.workspace = true
clap.workspace = true
dojo-lang.workspace = true
dojo-macros.workspace = true
8 changes: 1 addition & 7 deletions bin/dojo-language-server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
use cairo_lang_language_server::Tricks;
use clap::Parser;
use dojo_lang::dojo_plugin_suite;

/// Dojo Language Server
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {}

fn main() {
let _args = Args::parse();

let mut tricks = Tricks::default();
tricks.extra_plugin_suites = Some(&|| vec![dojo_plugin_suite()]);
cairo_lang_language_server::start_with_tricks(tricks);
cairo_lang_language_server::start();
}
1 change: 0 additions & 1 deletion bin/sozo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ clap.workspace = true
clap-verbosity-flag.workspace = true
colored.workspace = true
dojo-bindgen.workspace = true
dojo-lang.workspace = true
dojo-types.workspace = true
dojo-utils.workspace = true
dojo-world.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions bin/sozo/src/commands/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use cairo_lang_test_plugin::{test_plugin_suite, TestsCompilationConfig};
use cairo_lang_test_runner::{CompiledTestRunner, RunProfilerConfig, TestCompiler, TestRunConfig};
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use clap::Args;
use dojo_lang::dojo_plugin_suite;
use itertools::Itertools;
use scarb::compiler::{
CairoCompilationUnit, CompilationUnit, CompilationUnitAttributes, ContractSelector,
Expand Down Expand Up @@ -197,7 +196,6 @@ pub(crate) fn build_root_database(unit: &CairoCompilationUnit) -> Result<RootDat
b.with_cfg(CfgSet::from_iter([Cfg::name("test"), Cfg::kv("target", "test")]));

b.with_plugin_suite(test_plugin_suite());
b.with_plugin_suite(dojo_plugin_suite());
b.with_plugin_suite(starknet_plugin_suite());

b.build()
Expand Down
2 changes: 1 addition & 1 deletion crates/benches/contracts/src/models/character.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ struct Alias {
#[key]
player: ContractAddress,
name: felt252,
}
}
9 changes: 5 additions & 4 deletions crates/dojo/core-cairo-test/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ version = 1

[[package]]
name = "dojo"
version = "1.0.0-rc.0"
version = "1.0.1"
dependencies = [
"dojo_plugin",
"dojo_macros",
]

[[package]]
name = "dojo_cairo_test"
version = "1.0.0-rc.0"
dependencies = [
"dojo",
"dojo_macros",
]

[[package]]
name = "dojo_plugin"
version = "2.8.4"
name = "dojo_macros"
version = "0.1.0"
1 change: 1 addition & 0 deletions crates/dojo/core-cairo-test/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ dojo = { path = "../core" }

[dev-dependencies]
cairo_test = "=2.8.4"
dojo_macros = { path = "../macros" }

[lib]
4 changes: 2 additions & 2 deletions crates/dojo/core-cairo-test/src/tests/meta/introspect.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn test_layout_of_inner_packed_struct() {
}

#[test]
#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))]
#[should_panic(expected: "A packed model layout must contain Fixed layouts only.")]
fn test_layout_of_not_packed_inner_struct() {
let _ = Introspect::<StructInnerNotPacked>::layout();
}
Expand All @@ -304,7 +304,7 @@ fn test_layout_of_inner_packed_enum() {
}

#[test]
#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))]
#[should_panic(expected: "A packed model layout must contain Fixed layouts only.")]
fn test_layout_of_not_packed_inner_enum() {
let _ = Introspect::<EnumInnerNotPacked>::layout();
}
91 changes: 91 additions & 0 deletions crates/dojo/core-foundry-test/.snfoundry_cache/.prev_tests_failed
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
dojo_cairo_test::tests::contract::test_register_namespace_empty_name
dojo_cairo_test::tests::contract::test_upgrade_direct
dojo_cairo_test::tests::world::acl::test_grant_writer_through_malicious_contract
dojo_cairo_test::tests::contract::test_upgrade_from_world
dojo_cairo_test::tests::world::acl::test_grant_writer_fails_for_non_owner
dojo_cairo_test::tests::world::acl::test_not_writer_with_known_contract
dojo_cairo_test::tests::contract::test_upgrade_from_world_not_world_provider
dojo_cairo_test::tests::world::acl::test_owner
dojo_cairo_test::tests::world::acl::test_register_contract_namespace_not_owner
dojo_cairo_test::tests::world::acl::test_register_model_namespace_not_owner
dojo_cairo_test::tests::world::acl::test_writer
dojo_cairo_test::tests::world::contract::test_deploy_contract_for_namespace_owner
dojo_cairo_test::tests::world::acl::test_writer_not_registered_resource
dojo_cairo_test::tests::world::contract::test_deploy_contract_for_namespace_writer
dojo_cairo_test::tests::world::acl::test_revoke_owner_fails_for_non_owner
dojo_cairo_test::tests::world::contract::test_deploy_contract_through_malicious_contract
dojo_cairo_test::tests::world::contract::test_deploy_contract_no_namespace_owner_access
dojo_cairo_test::tests::world::contract::test_deploy_contract_with_unregistered_namespace
dojo_cairo_test::tests::world::acl::test_revoke_owner_through_malicious_contract
dojo_cairo_test::tests::world::acl::test_revoke_writer_fails_for_non_owner
dojo_cairo_test::tests::world::contract::test_upgrade_contract_from_random_account
dojo_cairo_test::tests::world::event::test_register_event_with_unregistered_namespace
dojo_cairo_test::tests::world::contract::test_upgrade_contract_from_resource_writer
dojo_cairo_test::tests::world::contract::test_upgrade_contract_from_resource_owner
dojo_cairo_test::tests::world::acl::test_revoke_writer_through_malicious_contract
dojo_cairo_test::tests::world::contract::test_upgrade_contract_through_malicious_contract
dojo_cairo_test::tests::world::event::test_upgrade_event
dojo_cairo_test::tests::world::event::test_upgrade_event_from_event_writer
dojo_cairo_test::tests::world::event::test_upgrade_event_from_event_owner
dojo_cairo_test::tests::world::event::test_upgrade_event_from_random_account
dojo_cairo_test::tests::world::contract::test_upgrade_direct
dojo_cairo_test::tests::world::event::test_upgrade_event_with_bad_layout_type
dojo_cairo_test::tests::world::contract::test_upgrade_from_world
dojo_cairo_test::tests::world::event::test_upgrade_event_with_member_added_but_removed
dojo_cairo_test::tests::world::contract::test_upgrade_from_world_not_world_provider
dojo_cairo_test::tests::world::event::test_upgrade_event_with_member_moved
dojo_cairo_test::tests::world::event::test_register_event_for_namespace_owner
dojo_cairo_test::tests::world::event::test_register_event_for_namespace_writer
dojo_cairo_test::tests::world::metadata::test_set_metadata_not_possible_for_random_account
dojo_cairo_test::tests::world::event::test_upgrade_event_with_member_removed
dojo_cairo_test::tests::world::event::test_register_event_through_malicious_contract
dojo_cairo_test::tests::world::model::test_register_model_for_namespace_writer
dojo_cairo_test::tests::world::metadata::test_set_metadata_world
dojo_cairo_test::tests::world::model::test_register_model_through_malicious_contract
dojo_cairo_test::tests::world::model::test_register_model_for_namespace_owner
dojo_cairo_test::tests::world::model::test_register_model_with_invalid_name
dojo_cairo_test::tests::world::model::test_register_model_with_unregistered_namespace
dojo_cairo_test::tests::world::model::test_upgrade_model_from_model_owner
dojo_cairo_test::tests::world::model::test_upgrade_model
dojo_cairo_test::tests::world::metadata::test_set_metadata_not_possible_for_resource_writer
dojo_cairo_test::tests::world::model::test_upgrade_model_from_model_writer
dojo_cairo_test::tests::world::namespace::test_register_namespace
dojo_cairo_test::tests::world::model::test_upgrade_model_with_member_removed
dojo_cairo_test::tests::world::metadata::test_set_metadata_through_malicious_contract
dojo_cairo_test::tests::world::metadata::test_set_metadata_resource_owner
dojo_cairo_test::tests::world::namespace::test_register_namespace_already_registered_other_caller
dojo_cairo_test::tests::world::model::test_upgrade_model_with_bad_layout_type
dojo_cairo_test::tests::world::model::test_upgrade_model_from_random_account
dojo_cairo_test::tests::world::storage::write_multiple_not_copiable
dojo_cairo_test::tests::world::model::test_upgrade_model_with_member_added_but_removed
dojo_cairo_test::tests::world::world::test_can_call_init_only_world
dojo_cairo_test::tests::world::model::test_upgrade_model_with_member_moved
dojo_cairo_test::tests::world::world::test_can_call_init_only_world_args
dojo_cairo_test::tests::world::world::test_contract_getter
dojo_cairo_test::tests::world::world::test_delete
dojo_cairo_test::tests::world::world::test_constructor_default
dojo_cairo_test::tests::world::world::test_emit
dojo_cairo_test::tests::world::world::test_model
dojo_cairo_test::tests::world::world::test_system
dojo_cairo_test::tests::world::world::test_execute_multiple_worlds
dojo_cairo_test::tests::world::world::test_upgradeable_world_from_non_owner
dojo_cairo_test::tests::world::world::test_upgradeable_world_with_class_hash_zero
dojo_cairo_test::tests::world::namespace::test_register_namespace_empty_name
dojo_cairo_test::tests::world::world::test_can_call_init_args
dojo_cairo_test::tests::world::world::test_upgradeable_world
dojo_cairo_test::tests::model::model::test_model_ptr_from_entity_id
dojo_cairo_test::tests::world::world::test_can_call_init_only_owner
dojo_cairo_test::tests::world::storage::write_multiple_copiable
dojo_cairo_test::tests::model::model::test_delete_from_model
dojo_cairo_test::tests::model::model::test_model_ptr_from_keys
dojo_cairo_test::tests::model::model::test_read_and_write_field_name
dojo_cairo_test::tests::model::model::test_model_ptr_from_serialized_keys
dojo_cairo_test::tests::model::model::test_read_and_update_model_value
dojo_cairo_test::tests::model::model::test_delete_model_value
dojo_cairo_test::tests::model::model::test_read_and_write_from_model
dojo_cairo_test::tests::world::acl::test_grant_owner_fails_for_non_owner
dojo_cairo_test::tests::world::acl::test_grant_owner_not_registered_resource
dojo_cairo_test::tests::world::namespace::test_register_namespace_already_registered_same_caller
dojo_cairo_test::tests::world::acl::test_grant_owner_through_malicious_contract
dojo_cairo_test::tests::world::world::test_can_call_init_default
dojo_cairo_test::tests::world::storage::write_simple
Loading

0 comments on commit 590b2ee

Please sign in to comment.