Skip to content

Commit

Permalink
fix: resolve compilation errors (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagadeeshftw authored Feb 6, 2025
1 parent 0319945 commit be14a5f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions onchain/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion onchain/src/models/game.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
28 changes: 14 additions & 14 deletions onchain/src/tests/test_game.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit be14a5f

Please sign in to comment.