Skip to content

Commit

Permalink
Merge pull request #342 from elopez/dev-fix-etherscan-brownie
Browse files Browse the repository at this point in the history
Improve etherscan and brownie tests
  • Loading branch information
montyly committed Jan 6, 2023
2 parents 0b03f41 + 3ea6558 commit 441cabd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
env:
TEST_TYPE: ${{ matrix.type }}
GITHUB_ETHERSCAN: ${{ secrets.GITHUB_ETHERSCAN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
bash "scripts/ci_test_${TEST_TYPE}.sh"
23 changes: 20 additions & 3 deletions scripts/ci_test_etherscan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,44 @@ cd "$DIR" || exit 255

solc-select use 0.4.25 --always-install

delay_no_key () {
# Perform a small sleep when API key is not available (e.g. on PR CI from external contributor)
if [ "$GITHUB_ETHERSCAN" = "" ]; then
sleep 5s
fi
}

echo "::group::Etherscan mainnet"
crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey "$GITHUB_ETHERSCAN"

if [ $? -ne 0 ]
then
echo "Etherscan test failed"
echo "Etherscan mainnet test failed"
exit 255
fi
echo "::endgroup::"

delay_no_key

echo "::group::Etherscan rinkeby"
crytic-compile rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --compile-remove-metadata --etherscan-apikey "$GITHUB_ETHERSCAN"

if [ $? -ne 0 ]
then
echo "Etherscan test failed"
echo "Etherscan rinkeby test failed"
exit 255
fi
echo "::endgroup::"

delay_no_key

# From crytic/slither#1154
echo "::group::Etherscan #3"
crytic-compile 0xcfc1E0968CA08aEe88CbF664D4A1f8B881d90f37 --compile-remove-metadata --etherscan-apikey "$GITHUB_ETHERSCAN"

if [ $? -ne 0 ]
then
echo "Etherscan test failed"
echo "Etherscan #3 test failed"
exit 255
fi
echo "::endgroup::"

0 comments on commit 441cabd

Please sign in to comment.