Skip to content

Commit 0b1120a

Browse files
committed
Run scarb 2.14.0 on ci
commit-id:7c262d66
1 parent ba95c4a commit 0b1120a

File tree

9 files changed

+20
-24
lines changed

9 files changed

+20
-24
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
version: [ 2.9.4, 2.10.1, 2.11.4, 2.12.2, 2.13.1 ]
15+
version: [ 2.9.4, 2.10.1, 2.11.4, 2.12.2, 2.13.1, 2.14.0 ]
1616
steps:
1717
- uses: actions/checkout@v6
1818
- uses: dtolnay/rust-toolchain@stable
@@ -25,7 +25,7 @@ jobs:
2525
- run: cargo test --release
2626
if: matrix.version == '2.9.4' || matrix.version == '2.10.1'
2727
- run: cargo test --release --features allows-excluding-macros
28-
if: matrix.version == '2.11.4' || matrix.version == '2.12.2' || matrix.version == '2.13.1'
28+
if: matrix.version != '2.9.4' && matrix.version != '2.10.1'
2929

3030
rustfmt:
3131
name: Check rust formatting

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
starknet-foundry 0.43.0
2-
scarb 2.9.4
2+
scarb 2.14.0

crates/cairo-coverage/src/commands/run.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ pub fn run(
2020
) -> Result<()> {
2121
let metadata = scarb_metadata()?;
2222

23-
if !include.contains(&IncludedComponent::Macros) {
24-
ensure!(
25-
metadata.app_version_info.version <= Version::new(2, 8, 5)
26-
|| metadata.app_version_info.version >= Version::new(2, 11, 0),
27-
"excluding macros is only supported for Scarb versions <= 2.8.5 and >= 2.11.0"
28-
);
29-
}
23+
ensure!(
24+
include.contains(&IncludedComponent::Macros)
25+
|| metadata.app_version_info.version >= Version::new(2, 11, 0),
26+
"excluding macros is only supported for Scarb versions >= 2.11.0"
27+
);
3028

3129
let project_path = project_path.unwrap_or(metadata.workspace.root);
3230

crates/cairo-coverage/tests/data/complex_calculator/src/lib.cairo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn factorial(n: u32) -> u32 {
2828
while i <= n {
2929
result *= i;
3030
i += 1;
31-
};
31+
}
3232
result
3333
}
3434

@@ -38,7 +38,7 @@ pub fn power(base: i32, exponent: u32) -> i32 {
3838
while exp > 0 {
3939
result *= base;
4040
exp -= 1;
41-
};
41+
}
4242
result
4343
}
4444

@@ -61,6 +61,6 @@ pub fn is_prime(n: u32) -> bool {
6161
result = false;
6262
}
6363
i += 1;
64-
};
64+
}
6565
result
6666
}

crates/cairo-coverage/tests/data/complex_calculator/tests/test_call.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use complex_calculator::{add, subtract, multiply, divide, factorial, power, is_prime, fibonacci};
1+
use complex_calculator::{add, divide, factorial, fibonacci, is_prime, multiply, power, subtract};
22

33
#[test]
44
fn test_add() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
mod simple;
21
mod multiply;
2+
mod simple;

crates/cairo-coverage/tests/data/readme_example/tests/lib.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use readme_example::{calculator, Operation};
1+
use readme_example::{Operation, calculator};
22

33
#[test]
44
fn calculator_add() {

crates/cairo-coverage/tests/data/scarb_template/src/lib.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn fib(mut n: u32) -> u32 {
1010
let temp = b;
1111
b = a + b;
1212
a = temp;
13-
};
13+
}
1414
a
1515
}
1616

crates/cairo-coverage/tests/data/snforge_template/tests/test_contract.cairo

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
use snforge_std::{ContractClassTrait, DeclareResultTrait, declare};
2+
use snforge_template::{
3+
IHelloStarknetDispatcher, IHelloStarknetDispatcherTrait, IHelloStarknetSafeDispatcher,
4+
IHelloStarknetSafeDispatcherTrait,
5+
};
16
use starknet::ContractAddress;
27

3-
use snforge_std::{declare, ContractClassTrait, DeclareResultTrait};
4-
5-
use snforge_template::IHelloStarknetSafeDispatcher;
6-
use snforge_template::IHelloStarknetSafeDispatcherTrait;
7-
use snforge_template::IHelloStarknetDispatcher;
8-
use snforge_template::IHelloStarknetDispatcherTrait;
9-
108
fn deploy_contract(name: ByteArray) -> ContractAddress {
119
let contract = declare(name).unwrap().contract_class();
1210
let (contract_address, _) = contract.deploy(@ArrayTrait::new()).unwrap();

0 commit comments

Comments
 (0)