From 221cfc69ce628db819c56f1ece4c4e82867bc386 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Mon, 3 Jun 2024 14:48:07 -0500 Subject: [PATCH] chore: remove unused scripts --- scripts/ci_test.sh | 84 -------------------------------------------- scripts/json_diff.py | 27 -------------- 2 files changed, 111 deletions(-) delete mode 100755 scripts/ci_test.sh delete mode 100644 scripts/json_diff.py diff --git a/scripts/ci_test.sh b/scripts/ci_test.sh deleted file mode 100755 index 6696a4e890..0000000000 --- a/scripts/ci_test.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -### Test Detectors - -DIR="$(cd "$(dirname "$0")" && pwd)" - -CURRENT_PATH=$(pwd) -TRAVIS_PATH='/home/travis/build/crytic/slither' - -# test_slither file.sol detectors -test_slither(){ - - expected="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.json" - - # run slither detector on input file and save output as json - if ! slither "$1" --solc-disable-warnings --detect "$2" --json "$DIR/tmp-test.json"; - then - echo "Slither crashed" - exit 255 - fi - - if [ ! -f "$DIR/tmp-test.json" ]; then - echo "" - echo "Missing generated file" - echo "" - exit 1 - fi - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$DIR/tmp-test.json" -i - result=$(python "$DIR/json_diff.py" "$expected" "$DIR/tmp-test.json") - - rm "$DIR/tmp-test.json" - if [ "$result" != "{}" ]; then - echo "" - echo "failed test of file: $1, detector: $2" - echo "" - echo "$result" - echo "" - exit 1 - fi - - # run slither detector on input file and save output as json - if ! slither "$1" --solc-disable-warnings --detect "$2" --legacy-ast --json "$DIR/tmp-test.json"; - then - echo "Slither crashed" - exit 255 - fi - - if [ ! -f "$DIR/tmp-test.json" ]; then - echo "" - echo "Missing generated file" - echo "" - exit 1 - fi - - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$DIR/tmp-test.json" -i - result=$(python "$DIR/json_diff.py" "$expected" "$DIR/tmp-test.json") - - rm "$DIR/tmp-test.json" - if [ "$result" != "{}" ]; then - echo "" - echo "failed test of file: $1, detector: $2" - echo "" - echo "$result" - echo "" - exit 1 - fi -} - -# generate_expected_json file.sol detectors -generate_expected_json(){ - # generate output filename - # e.g. file: uninitialized.sol detector: uninitialized-state - # ---> uninitialized.uninitialized-state.json - output_filename="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.json" - output_filename_txt="$DIR/../tests/expected_json/$(basename "$1" .sol).$2.txt" - - # run slither detector on input file and save output as json - slither "$1" --solc-disable-warnings --detect "$2" --json "$output_filename" > "$output_filename_txt" 2>&1 - - - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$output_filename" -i - sed "s|$CURRENT_PATH|$TRAVIS_PATH|g" "$output_filename_txt" -i -} - diff --git a/scripts/json_diff.py b/scripts/json_diff.py deleted file mode 100644 index 9422f6b8df..0000000000 --- a/scripts/json_diff.py +++ /dev/null @@ -1,27 +0,0 @@ -import sys -import json -from pprint import pprint -from deepdiff import DeepDiff # pip install deepdiff - - -if len(sys.argv) != 3: - print("Usage: python json_diff.py 1.json 2.json") - sys.exit(-1) - -with open(sys.argv[1], encoding="utf8") as f: - d1 = json.load(f) - -with open(sys.argv[2], encoding="utf8") as f: - d2 = json.load(f) - - -# Remove description field to allow non deterministic print -for elem in d1: - if "description" in elem: - del elem["description"] -for elem in d2: - if "description" in elem: - del elem["description"] - - -pprint(DeepDiff(d1, d2, ignore_order=True, verbose_level=2))