Skip to content

Commit

Permalink
Remove cairo 0 contracts compiling script and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kkawula committed Aug 19, 2024
1 parent 4eb752c commit 67af1cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,33 +120,6 @@ jobs:
if: steps.cache-contracts_v1.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts v1
# ====================== CONTRACTS v0 ====================== #

- name: Cache contracts v0
id: cache-contracts
uses: actions/cache@v3
with:
path: starknet_py/tests/e2e/mock/contracts_compiled
key: ${{ runner.os }}-contracts-${{ hashFiles('starknet_py/tests/e2e/mock/contracts', 'poetry.lock') }}-${{ env.CAIRO_LANG_VERSION }}

- name: Install deprecated cairo compiler
if: steps.cache-contracts.outputs.cache-hit != 'true'
run: |
pip install --upgrade setuptools
pip install sympy==1.11.1
pip install cairo-lang==${{ env.CAIRO_LANG_VERSION }}
- name: Compile contracts v0
if: steps.cache-contracts.outputs.cache-hit != 'true'
run: |
poetry run poe compile_contracts v0
- name: Upload contracts v0
uses: actions/upload-artifact@v3
with:
name: contract-artifacts
path: starknet_py/tests/e2e/mock/
# ---------------------------------------------------------- #
# ........................RUN-TESTS......................... #
Expand Down
34 changes: 0 additions & 34 deletions starknet_py/tests/e2e/mock/compile_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,14 @@ compile_contracts_with_scarb() {
popd >/dev/null || exit 1
}

compile_contracts_v0() {
CONTRACTS_DIRECTORY="$MOCK_DIRECTORY/contracts"
CONTRACTS_COMPILED_DIRECTORY="$MOCK_DIRECTORY/contracts_compiled"

mkdir -p "$CONTRACTS_COMPILED_DIRECTORY"

# delete all artifacts except precompiled ones
find "$CONTRACTS_COMPILED_DIRECTORY" -maxdepth 1 -type f -delete

# compile Cairo test contracts
echo "Compiling Cairo contracts with $(poetry run starknet-compile-deprecated --version)"

for contract in "$CONTRACTS_DIRECTORY"/*.cairo; do
basename=$(basename "$contract")

output="$CONTRACTS_COMPILED_DIRECTORY/${basename%.*}_compiled.json"
abi="$CONTRACTS_COMPILED_DIRECTORY/${basename%.*}_abi.json"

# set account contract flag
account_contract_flag=""
if [[ $basename == *"account"* ]]; then
account_contract_flag="--account_contract"
fi

echo "Compiling $contract..."
poetry run starknet-compile-deprecated $account_contract_flag --cairo_path "$CONTRACTS_DIRECTORY:$MOCK_DIRECTORY" --output "$output" --abi "$abi" "$contract"
done

}

case "$1" in
"v0")
compile_contracts_v0
;;
"v1")
compile_contracts_with_scarb "$CONTRACTS_DIRECTORY_V1"
;;
"v2")
compile_contracts_with_scarb "$CONTRACTS_DIRECTORY_V2"
;;
*)
compile_contracts_v0
compile_contracts_with_scarb "$CONTRACTS_DIRECTORY_V1"
compile_contracts_with_scarb "$CONTRACTS_DIRECTORY_V2"
;;
Expand Down

0 comments on commit 67af1cc

Please sign in to comment.