Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Oct 13, 2023
1 parent a73bff6 commit 8dc1a98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/game/src/game/interfaces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use survivor::{
trait IGame<TContractState> {
// ------ Game Actions ------
fn new_game(
ref self: TContractState, client_reward_address: ContractAddress, weapon: u8, name: u128
ref self: TContractState, client_reward_address: ContractAddress, weapon: u8, name: u128, golden_token_id: u256
);
fn explore(ref self: TContractState, adventurer_id: felt252, till_beast: bool);
fn attack(ref self: TContractState, adventurer_id: felt252, to_the_death: bool);
Expand Down
5 changes: 3 additions & 2 deletions contracts/game/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ mod Game {
array::{SpanTrait, ArrayTrait}, integer::u256_try_as_non_zero, traits::{TryInto, Into},
clone::Clone, poseidon::poseidon_hash_span, option::OptionTrait, box::BoxTrait,
starknet::{
get_caller_address, ContractAddress, ContractAddressIntoFelt252, contract_address_const, get_block_timestamp
get_caller_address, ContractAddress, ContractAddressIntoFelt252, contract_address_const,
get_block_timestamp
},
};

Expand Down Expand Up @@ -3461,7 +3462,7 @@ mod Game {
};

assert(_can_play(@self, token_id), 'Cant play');
assert(golden_token.owner_of(token_id) == account, 'Not owner');
assert(golden_token.owner_of(token_id) == player, 'Not owner');

self
._golden_token_last_use
Expand Down
4 changes: 2 additions & 2 deletions contracts/game/src/tests/test_game.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mod tests {
}

fn add_adventurer_to_game(ref game: IGameDispatcher) {
game.new_game(INTERFACE_ID(), ItemId::Wand, 'loothero', DEFAULT_NO_GOLDEN_TOKEN);
game.new_game(INTERFACE_ID(), ItemId::Wand, 'loothero', DEFAULT_NO_GOLDEN_TOKEN.into());

let original_adventurer = game.get_adventurer(ADVENTURER_ID);
assert(original_adventurer.xp == 0, 'wrong starting xp');
Expand All @@ -124,7 +124,7 @@ mod tests {
let name = 'abcdefghijklmno';

// start new game
game.new_game(INTERFACE_ID(), starting_weapon, name, DEFAULT_NO_GOLDEN_TOKEN);
game.new_game(INTERFACE_ID(), starting_weapon, name, DEFAULT_NO_GOLDEN_TOKEN.into());

// get adventurer state
let adventurer = game.get_adventurer(ADVENTURER_ID);
Expand Down

0 comments on commit 8dc1a98

Please sign in to comment.