Skip to content

Commit

Permalink
Merge pull request #74 from glihm/main
Browse files Browse the repository at this point in the history
fix: update to 1.0.0-alpha.4
  • Loading branch information
glihm committed Aug 4, 2024
2 parents 7c01064 + 60585fd commit 5887882
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: curl -L https://install.dojoengine.org | bash
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.0-alpha.3
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.0-alpha.4
- run: |
/home/runner/.config/.dojo/bin/sozo build
/home/runner/.config/.dojo/bin/sozo test
Expand Down
2 changes: 1 addition & 1 deletion Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = 1
[[package]]
name = "dojo"
version = "0.7.3"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.3#a6a7724380169372336e886fb36f31f56e7d0d8a"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-alpha.4#d08c46191fc1b4c4f90816cef4787cb8db02988f"
dependencies = [
"dojo_plugin",
]
Expand Down
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spawn = "./scripts/spawn.sh"
move = "./scripts/move.sh"

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.3" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.4" }

[[target.dojo]]

Expand Down
56 changes: 44 additions & 12 deletions manifests/dev/base/abis/dojo-world.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@
"type": "function",
"name": "is_owner",
"inputs": [
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "resource",
"type": "core::felt252"
},
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
}
],
"outputs": [
Expand All @@ -414,13 +414,13 @@
"type": "function",
"name": "grant_owner",
"inputs": [
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "resource",
"type": "core::felt252"
},
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
}
],
"outputs": [],
Expand All @@ -430,13 +430,13 @@
"type": "function",
"name": "revoke_owner",
"inputs": [
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
},
{
"name": "resource",
"type": "core::felt252"
},
{
"name": "address",
"type": "core::starknet::contract_address::ContractAddress"
}
],
"outputs": [],
Expand Down Expand Up @@ -975,6 +975,33 @@
}
]
},
{
"type": "event",
"name": "dojo::world::world_contract::world::StoreUpdateMember",
"kind": "struct",
"members": [
{
"name": "table",
"type": "core::felt252",
"kind": "data"
},
{
"name": "entity_id",
"type": "core::felt252",
"kind": "data"
},
{
"name": "member_selector",
"type": "core::felt252",
"kind": "data"
},
{
"name": "values",
"type": "core::array::Span::<core::felt252>",
"kind": "data"
}
]
},
{
"type": "event",
"name": "dojo::world::world_contract::world::StoreDelRecord",
Expand Down Expand Up @@ -1156,6 +1183,11 @@
"type": "dojo::world::world_contract::world::StoreUpdateRecord",
"kind": "nested"
},
{
"name": "StoreUpdateMember",
"type": "dojo::world::world_contract::world::StoreUpdateMember",
"kind": "nested"
},
{
"name": "StoreDelRecord",
"type": "dojo::world::world_contract::world::StoreDelRecord",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f"
original_class_hash = "0x58bba620da6e6411af49f295669985f8832c56caae31903e1078e149356115f"
class_hash = "0x417cbd6fb05fb73eef19c2eefffeb9897007add48b949f0c7ce234566cb8604"
original_class_hash = "0x417cbd6fb05fb73eef19c2eefffeb9897007add48b949f0c7ce234566cb8604"
base_class_hash = "0x0"
abi = "manifests/dev/base/abis/contracts/dojo_starter-actions-7a1c7102.json"
reads = []
Expand Down
4 changes: 2 additions & 2 deletions manifests/dev/base/dojo-world.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "Class"
class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde"
original_class_hash = "0x32fb65ebfe6d91bb4b7ba0640650722c43ca0c917f5fc0f649ee2ecf720cde"
class_hash = "0x2178527e9556d1aa21d3c2961d28f9114fcfed81b4c3674ed591c50ce46cc9d"
original_class_hash = "0x2178527e9556d1aa21d3c2961d28f9114fcfed81b4c3674ed591c50ce46cc9d"
abi = "manifests/dev/base/abis/dojo-world.json"
tag = "dojo-world"
manifest_name = "dojo-world"
33 changes: 17 additions & 16 deletions src/tests/test_world.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,29 @@ mod tests {
let actions_system = IActionsDispatcher { contract_address };
// call spawn()
actions_system.spawn();
// // call move with direction right
// actions_system.move(Direction::Right);

// // Check world state
// let moves = get!(world, caller, Moves);
// call move with direction right
actions_system.move(Direction::Right);

// // casting right direction
// let right_dir_felt: felt252 = Direction::Right.into();
// Check world state
let moves = get!(world, caller, Moves);

// // check moves
// assert(moves.remaining == 99, 'moves is wrong');
// casting right direction
let right_dir_felt: felt252 = Direction::Right.into();

// // check last direction
// assert(moves.last_direction.into() == right_dir_felt, 'last direction is wrong');
// check moves
assert(moves.remaining == 99, 'moves is wrong');

// // get new_position
// let new_position = get!(world, caller, Position);
// check last direction
assert(moves.last_direction.into() == right_dir_felt, 'last direction is wrong');

// // check new position x
// assert(new_position.vec.x == 11, 'position x is wrong');
// get new_position
let new_position = get!(world, caller, Position);

// // check new position y
// assert(new_position.vec.y == 10, 'position y is wrong');
// check new position x
assert(new_position.vec.x == 11, 'position x is wrong');

// check new position y
assert(new_position.vec.y == 10, 'position y is wrong');
}
}

0 comments on commit 5887882

Please sign in to comment.