Skip to content

Commit

Permalink
Merge branch 'main' into builtin_costs
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l authored Oct 10, 2024
2 parents f86f981 + 82c25b3 commit c71bbf0
Show file tree
Hide file tree
Showing 31 changed files with 1,113 additions and 803 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ jobs:
run: make runtime-ci && make check-llvm && make needs-cairo2 && make build-alexandria

- name: Run tests and generate coverage partition ${{ matrix.partition }}
run: cargo llvm-cov nextest --verbose --all-features --workspace --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4
run: cargo llvm-cov nextest --verbose --features=scarb --workspace --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4

- name: test and generate coverage corelib
if: ${{ matrix.partition == '1' }}
run: cargo llvm-cov nextest --verbose --all-features --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib
run: cargo llvm-cov nextest --verbose --features=scarb --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib

- name: save coverage data with corelib
if: ${{ matrix.partition == '1' }}
Expand All @@ -275,7 +275,6 @@ jobs:
name: coverage-data-${{ matrix.partition }}
path: ./${{ matrix.output }}


upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ build-cli = [
"dep:colored",
]
scarb = ["build-cli", "dep:scarb-ui", "dep:scarb-metadata"]
with-cheatcode = []
with-debug-utils = []
with-mem-tracing = []
with-runtime = ["dep:cairo-native-runtime"]
with-cheatcode = []

# the aquamarine dep is only used in docs and cannot be detected as used by cargo udeps
[package.metadata.cargo-udeps.ignore]
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ endif

.PHONY: build
build: check-llvm runtime
cargo build --release --all-features
cargo build --release --features=scarb

.PHONY: build-natives
build-native: check-llvm runtime
RUSTFLAGS="-C target-cpu=native" cargo build --release --all-features
RUSTFLAGS="-C target-cpu=native" cargo build --release --features=scarb

.PHONY: build-dev
build-dev: check-llvm
cargo build --profile optimized-dev --all-features
cargo build --profile optimized-dev --features=scarb

.PHONY: check
check: check-llvm
Expand All @@ -63,28 +63,28 @@ check: check-llvm

.PHONY: test
test: check-llvm needs-cairo2 build-alexandria runtime-ci
cargo test --profile ci --all-features
cargo test --profile ci --features=scarb,with-cheatcode,with-debug-utils

.PHONY: test-cairo
test-cairo: check-llvm needs-cairo2 build-alexandria runtime-ci
cargo r --profile ci --bin cairo-native-test -- corelib

.PHONY: proptest
proptest: check-llvm needs-cairo2 runtime-ci
cargo test --profile ci --all-features proptest
cargo test --profile ci --features=scarb,with-cheatcode,with-debug-utils proptest

.PHONY: test-cli
test-ci: check-llvm needs-cairo2 build-alexandria runtime-ci
cargo test --profile ci --all-features
cargo test --profile ci --features=scarb,with-cheatcode,with-debug-utils

.PHONY: proptest-cli
proptest-ci: check-llvm needs-cairo2 runtime-ci
cargo test --profile ci --all-features proptest
cargo test --profile ci --features=scarb,with-cheatcode,with-debug-utils proptest

.PHONY: coverage
coverage: check-llvm needs-cairo2 build-alexandria runtime-ci
cargo llvm-cov --verbose --profile ci --all-features --workspace --lcov --output-path lcov.info
cargo llvm-cov --verbose --profile ci --all-features --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib
cargo llvm-cov --verbose --profile ci --features=scarb,with-cheatcode,with-debug-utils --workspace --lcov --output-path lcov.info
cargo llvm-cov --verbose --profile ci --features=scarb,with-cheatcode,with-debug-utils --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib

.PHONY: doc
doc: check-llvm
Expand All @@ -100,7 +100,7 @@ bench: build needs-cairo2 runtime

.PHONY: bench-ci
bench-ci: check-llvm needs-cairo2 runtime
cargo criterion --all-features
cargo criterion --features=scarb,with-cheatcode,with-debug-utils

.PHONY: stress-test
stress-test: check-llvm
Expand All @@ -116,7 +116,7 @@ stress-clean:

.PHONY: install
install: check-llvm
RUSTFLAGS="-C target-cpu=native" cargo install --all-features --locked --path .
RUSTFLAGS="-C target-cpu=native" cargo install --features=scarb,with-cheatcode --locked --path .

.PHONY: clean
clean: stress-clean
Expand Down
6 changes: 3 additions & 3 deletions examples/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ impl StarknetSyscallHandler for SyscallHandler {

fn sha256_process_block(
&mut self,
_prev_state: &[u32; 8],
_current_block: &[u32; 16],
_state: &mut [u32; 8],
_block: &[u32; 16],
_remaining_gas: &mut u128,
) -> SyscallResult<[u32; 8]> {
) -> SyscallResult<()> {
unimplemented!()
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ impl StarknetSyscallHandler for SyscallHandler {

fn sha256_process_block(
&mut self,
_prev_state: &[u32; 8],
_current_block: &[u32; 16],
_state: &mut [u32; 8],
_block: &[u32; 16],
_remaining_gas: &mut u128,
) -> SyscallResult<[u32; 8]> {
) -> SyscallResult<()> {
unimplemented!()
}
}
Expand Down
Loading

0 comments on commit c71bbf0

Please sign in to comment.