diff --git a/onchain/Scarb.lock b/onchain/Scarb.lock index 6be1ac4..3a31a08 100644 --- a/onchain/Scarb.lock +++ b/onchain/Scarb.lock @@ -24,8 +24,8 @@ source = "git+https://github.com/dojoengine/dojo?tag=v1.1.2#4f3373ed4f98e1778022 [[package]] name = "origami_random" -version = "1.0.0-rc.2" -source = "git+https://github.com/dojoengine/origami#8e9a2bd3a3c0624102243d3956b31809aa532581" +version = "1.1.2" +source = "git+https://github.com/dojoengine/origami#4d6a98e4fee4c71c885a1669660a545b979283c7" [[package]] name = "starkludo" diff --git a/onchain/src/models/game.cairo b/onchain/src/models/game.cairo index 6e19737..26c3446 100644 --- a/onchain/src/models/game.cairo +++ b/onchain/src/models/game.cairo @@ -69,7 +69,7 @@ pub struct Game { pub b0: felt252, // blue piece position on board pub b1: felt252, // blue piece position on board pub b2: felt252, // blue piece position on board - pub b3: felt252 // blue piece position on board + pub b3: felt252, // blue piece position on board } pub trait GameTrait { diff --git a/onchain/src/tests/test_game.cairo b/onchain/src/tests/test_game.cairo index 15db080..c89c44a 100644 --- a/onchain/src/tests/test_game.cairo +++ b/onchain/src/tests/test_game.cairo @@ -434,7 +434,7 @@ mod tests { world.write_model(@game); // Move piece from initial position with dice throw 6 - game_action_system.move('r0', 0, game_id); + game_action_system.move('r0', 0); let game: Game = world.read_model(game_id); @@ -467,7 +467,7 @@ mod tests { testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('r0', 0, game_id); + game_action_system.move('r0', 0); // Verify the new position let game: Game = world.read_model(game_id); @@ -498,13 +498,13 @@ mod tests { game.dice_face = 6; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('r1', 0, game_id); // move from its initial position to 1. + game_action_system.move('r1', 0); // move from its initial position to 1. let mut game: Game = world.read_model(game_id); game.dice_face = 5; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('r1', 0, game_id); // move from 1 to 6. + game_action_system.move('r1', 0); // move from 1 to 6. // Verify the new position let game: Game = world.read_model(game_id); @@ -534,19 +534,19 @@ mod tests { game.dice_face = 6; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g1', 1, game_id); // move from its initial position to 14. + game_action_system.move('g1', 1); // move from its initial position to 14. let mut game: Game = world.read_model(game_id); game.dice_face = 5; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g1', 1, game_id); // move from 14 to 19. + game_action_system.move('g1', 1); // move from 14 to 19. let mut game: Game = world.read_model(game_id); game.dice_face = 3; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g1', 1, game_id); // move from 19 to 22. + game_action_system.move('g1', 1); // move from 19 to 22. // Verify the new position let game: Game = world.read_model(game_id); @@ -575,25 +575,25 @@ mod tests { game.dice_face = 6; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g1', 1, game_id); // move g1 from its initial position to 14. + game_action_system.move('g1', 1); // move g1 from its initial position to 14. let mut game: Game = world.read_model(game_id); game.dice_face = 6; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g2', 1, game_id); // move g2 from its initial position to 14. + game_action_system.move('g2', 1); // move g2 from its initial position to 14. let mut game: Game = world.read_model(game_id); game.dice_face = 5; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g1', 1, game_id); // move from 14 to 19. + game_action_system.move('g1', 1); // move from 14 to 19. let mut game: Game = world.read_model(game_id); game.dice_face = 5; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('g2', 1, game_id); // move from 14 to 19. + game_action_system.move('g2', 1); // move from 14 to 19. // Verify the new position let game: Game = world.read_model(game_id); @@ -637,7 +637,7 @@ mod tests { assert(game.game_condition == game_condition, 'Game Condition should match'); // Move red piece to position 15 - game_action_system.move('r0', 0, game_id); + game_action_system.move('r0', 0); // Verify the new positions game = world.read_model(game_id); @@ -683,7 +683,7 @@ mod tests { let game_condition = array![13, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; assert(game.game_condition == game_condition, 'Game Condition should match'); - game_action_system.move('r0', 0, game_id); + game_action_system.move('r0', 0); // Verify the new positions game = world.read_model(game_id); @@ -718,7 +718,7 @@ mod tests { game.dice_face = 3; testing::set_contract_address(game_action_system.contract_address); world.write_model(@game); - game_action_system.move('r3', 0, game_id); + game_action_system.move('r3', 0); // Verify the new positions and winning state game = world.read_model(game_id);