Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue exploring after discovering health or gold (#567) #569

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion contracts/game/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ mod Game {
// on non-mainnet, use the current block timestamp so tests run correctly
self._genesis_timestamp.write(starknet::get_block_info().unbox().block_timestamp.into());
};


// set the golden token address
self._golden_token.write(golden_token_address);
Expand Down Expand Up @@ -1626,6 +1626,14 @@ mod Game {
},
ExploreResult::Discovery(()) => {
_process_discovery(ref self, ref adventurer, adventurer_id, rnd2);
_explore(
ref self,
ref adventurer,
adventurer_id,
adventurer_entropy,
game_entropy,
explore_till_beast
)
}
}

Expand Down
7 changes: 0 additions & 7 deletions contracts/game/src/tests/test_game.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2615,12 +2615,6 @@ mod tests {
game.explore(ADVENTURER_ID, false);
testing::set_block_number(starting_block + 10);
testing::set_block_timestamp(starting_time + 150);
game.explore(ADVENTURER_ID, false);
testing::set_block_number(starting_block + 11);
testing::set_block_timestamp(starting_time + 165);
game.explore(ADVENTURER_ID, false);
testing::set_block_number(starting_block + 12);
testing::set_block_timestamp(starting_time + 180);

// with 15s block intervals, the rate limit will be 2 actions per block
// try to do three actions in a single block and verify contract panics
Expand All @@ -2641,7 +2635,6 @@ mod tests {

game.upgrade(ADVENTURER_ID, 0, stat_upgrades, shopping_cart);
game.explore(ADVENTURER_ID, false);
game.explore(ADVENTURER_ID, false);

// advancing block resets players action per block
starknet::testing::set_block_number(starting_block + 1);
Expand Down
Loading