Skip to content

Commit

Permalink
removed tests from actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ametel01 committed Dec 31, 2023
1 parent 425f8ef commit 0512da2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 27 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Test
# name: Test

on: [push, pull_request]
# on: [push, pull_request]

env:
SCARB_VERSION: 2.3.1
SNFORGE_VERSION: 0.12.0
# env:
# SCARB_VERSION: 2.3.1
# SNFORGE_VERSION: 0.12.0

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: ${{ env.SCARB_VERSION }}
- uses: foundry-rs/setup-snfoundry@v2
with:
starknet-foundry-version: ${{ env.SNFORGE_VERSION }}
- name: Run cairo tests
run:
snforge test
# jobs:
# check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: software-mansion/setup-scarb@v1
# with:
# scarb-version: ${{ env.SCARB_VERSION }}
# - uses: foundry-rs/setup-snfoundry@v2
# with:
# starknet-foundry-version: ${{ env.SNFORGE_VERSION }}
# - name: Run cairo tests
# run:
# snforge test
8 changes: 5 additions & 3 deletions src/game/main.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,9 @@ mod NoGame {
let collectible = self.get_collectible_resources(mission.destination);
let mut available_to_loot: ERC20s = Default::default();
available_to_loot.steel = available_to_loot.steel + spendable.steel / 2;
available_to_loot.quartz =available_to_loot.quartz + spendable.quartz / 2;
available_to_loot.quartz = available_to_loot.quartz + spendable.quartz / 2;
available_to_loot.tritium = available_to_loot.tritium + spendable.tritium / 2;
available_to_loot =available_to_loot + collectible;
available_to_loot = available_to_loot + collectible;
let storage = fleet::get_fleet_cargo_capacity(f1);
loot_amount = fleet::load_resources(available_to_loot, storage);
self.resources_timer.write(mission.destination, time_now);
Expand Down Expand Up @@ -1548,7 +1548,9 @@ mod NoGame {
return ERC20s { steel: _steel, quartz: _quartz, tritium: _tritium, };
}

ERC20s { steel: raw.steel / 3600, quartz: raw.quartz / 3600, tritium: raw.tritium / 3600}
ERC20s {
steel: raw.steel / 3600, quartz: raw.quartz / 3600, tritium: raw.tritium / 3600
}
}

fn calculate_energy_consumption(self: @ContractState, compounds: CompoundsLevels) -> u128 {
Expand Down
17 changes: 12 additions & 5 deletions src/tests/view_tests/general_view.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,21 @@ fn test_get_collectible_resources() {
}

#[test]
#[fork(url: "https://starknet-sepolia.blastapi.io/e88cff07-b7b6-48d0-8be6-292f660dc735/rpc/v0_6", block_id: BlockId::Number(12196))]
#[fork(
url: "https://starknet-sepolia.blastapi.io/e88cff07-b7b6-48d0-8be6-292f660dc735/rpc/v0_6",
block_id: BlockId::Number(12196)
)]
fn test_fork_get_collectible_resources() {
let contract_address = contract_address_const::<0x07287f2df129f8869638b5e7bf1b9e5961e57836f9762c8caa80e9e7831eeadc>();
let account = contract_address_const::<0x02e492bffa91eb61dbebb7b70c4520f9a1ec2a66ec8559a943a87d299b2782c7>();
let collectible = INoGameDispatcher{contract_address}.get_collectible_resources(1);
let contract_address = contract_address_const::<
0x07287f2df129f8869638b5e7bf1b9e5961e57836f9762c8caa80e9e7831eeadc
>();
let account = contract_address_const::<
0x02e492bffa91eb61dbebb7b70c4520f9a1ec2a66ec8559a943a87d299b2782c7
>();
let collectible = INoGameDispatcher { contract_address }.get_collectible_resources(1);
collectible.print();
start_prank(CheatTarget::One(contract_address), account);
let collectible = INoGameDispatcher{contract_address}.collect_resources();
let collectible = INoGameDispatcher { contract_address }.collect_resources();
}

#[test]
Expand Down

0 comments on commit 0512da2

Please sign in to comment.