Skip to content

Commit

Permalink
make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoGiachetta committed Oct 23, 2024
1 parent a847487 commit afc6568
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/starknet-blocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
run: |
cd replay
sed -r -i 's/cairo_native.*rev.*[0-9a-z]+./cairo_native.git", rev = "${{ github.event.pull_request.head.sha }}"/' Cargo.toml
cargo update
cargo build --release --bin replay
- name: Run Blocks Native
if: ${{ matrix.runner == 'native' }}
Expand Down Expand Up @@ -131,8 +131,10 @@ jobs:

- name: Check Diffs
run: |
diffing=./scripts/diff-check.sh
if cmp -s $diffing 1
results=./scripts/diff-check.sh
if \
cmp -s ${results[0]} 1 \
&& cmp -s ${results[1]} 0
then
exit 1
fi
14 changes: 12 additions & 2 deletions scripts/diff-check.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/usr/bin/env bash

diffing=0
skipping=0

for vm_dump in state_dumps/vm/*/*.json; do
[ -f "$vm_dump" ] || continue

native_dump="${vm_dump//vm/native}"

base=$(basename "$native_dump")
# Check if the corresponding native_dump file exists, if not, skip
if [ ! -f "$native_dump" ]; then
echo "Skipping: $native_dump (file not found)"
skipping=$((skipping+1))
continue
fi

base=$(basename "$vm_dump")

if ! cmp -s \
<(sed '/"reverted": /d' "$native_dump") \
Expand All @@ -18,4 +26,6 @@ for vm_dump in state_dumps/vm/*/*.json; do
fi
done

echo $diffing
local -a results=($diffing $skipping)

echo $results

0 comments on commit afc6568

Please sign in to comment.