Skip to content

Commit 441cabd

Browse files
authored
Merge pull request #342 from elopez/dev-fix-etherscan-brownie
Improve etherscan and brownie tests
2 parents 0b03f41 + 3ea6558 commit 441cabd

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
env:
7070
TEST_TYPE: ${{ matrix.type }}
7171
GITHUB_ETHERSCAN: ${{ secrets.GITHUB_ETHERSCAN }}
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7273
shell: bash
7374
run: |
7475
bash "scripts/ci_test_${TEST_TYPE}.sh"

scripts/ci_test_etherscan.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,44 @@ cd "$DIR" || exit 255
77

88
solc-select use 0.4.25 --always-install
99

10+
delay_no_key () {
11+
# Perform a small sleep when API key is not available (e.g. on PR CI from external contributor)
12+
if [ "$GITHUB_ETHERSCAN" = "" ]; then
13+
sleep 5s
14+
fi
15+
}
16+
17+
echo "::group::Etherscan mainnet"
1018
crytic-compile 0x7F37f78cBD74481E593F9C737776F7113d76B315 --compile-remove-metadata --etherscan-apikey "$GITHUB_ETHERSCAN"
1119

1220
if [ $? -ne 0 ]
1321
then
14-
echo "Etherscan test failed"
22+
echo "Etherscan mainnet test failed"
1523
exit 255
1624
fi
25+
echo "::endgroup::"
1726

27+
delay_no_key
28+
29+
echo "::group::Etherscan rinkeby"
1830
crytic-compile rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --compile-remove-metadata --etherscan-apikey "$GITHUB_ETHERSCAN"
1931

2032
if [ $? -ne 0 ]
2133
then
22-
echo "Etherscan test failed"
34+
echo "Etherscan rinkeby test failed"
2335
exit 255
2436
fi
37+
echo "::endgroup::"
38+
39+
delay_no_key
2540

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

2945
if [ $? -ne 0 ]
3046
then
31-
echo "Etherscan test failed"
47+
echo "Etherscan #3 test failed"
3248
exit 255
3349
fi
50+
echo "::endgroup::"

0 commit comments

Comments
 (0)