Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Oct 24, 2023
1 parent bff53f1 commit ff603ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
10 changes: 5 additions & 5 deletions crates/dojo-lang/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};
use std::iter::zip;
use std::ops::{Deref, DerefMut};

Expand Down Expand Up @@ -259,8 +259,8 @@ fn update_manifest(
Class { name: BASE_CONTRACT_NAME.into(), abi: abi.clone(), class_hash: *hash }
};

let mut models = HashMap::new();
let mut contracts = HashMap::new();
let mut models = BTreeMap::new();
let mut contracts = BTreeMap::new();

for crate_id in crate_ids {
for module_id in db.crate_modules(*crate_id).as_ref() {
Expand Down Expand Up @@ -355,8 +355,8 @@ fn do_update_manifest(
world: dojo_world::manifest::Contract,
executor: dojo_world::manifest::Contract,
base: dojo_world::manifest::Class,
models: HashMap<String, dojo_world::manifest::Model>,
contracts: HashMap<SmolStr, dojo_world::manifest::Contract>,
models: BTreeMap<String, dojo_world::manifest::Model>,
contracts: BTreeMap<SmolStr, dojo_world::manifest::Contract>,
) -> anyhow::Result<()> {
if manifest.world.class_hash != world.class_hash {
manifest.world = world;
Expand Down
31 changes: 0 additions & 31 deletions crates/dojo-lang/src/compiler_test.rs
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
use std::ops::Deref;
use std::path::Path;
use std::{env, fs};

use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use dojo_test_utils::compiler::build_test_config;
use scarb::ops;
use starknet::macros::felt;

#[test]
fn test_compiler() {
let config = build_test_config("../../examples/spawn-and-move/Scarb.toml").unwrap();
let ws = ops::read_workspace(config.manifest_path(), &config).unwrap();
let packages = ws.members().map(|p| p.id).collect();
let dojo_manifest_path = format!("{}/manifest.json", config.profile().as_str());

assert!(ops::compile(packages, &ws).is_ok(), "compilation failed");

let mut manifest = config
.target_dir()
.open_ro(&dojo_manifest_path, "output file", ws.config())
.map(|file| dojo_world::manifest::Manifest::try_from(file.deref()).unwrap_or_default())
.unwrap();

let world_address = Some(felt!("0xbeef"));
manifest.world.address = world_address;

manifest
.write_to_path(
config
.target_dir()
.open_rw(&dojo_manifest_path, "output file", ws.config())
.unwrap()
.path(),
)
.unwrap();

let manifest = config
.target_dir()
.open_ro(dojo_manifest_path, "output file", ws.config())
.map(|file| dojo_world::manifest::Manifest::try_from(file.deref()).unwrap_or_default())
.unwrap();

assert_eq!(manifest.world.address, world_address, "manifest should be fully overritten");
}

cairo_lang_test_utils::test_file_test!(
Expand Down

0 comments on commit ff603ca

Please sign in to comment.