ci: etherscan: sleep briefly when the API key is not available

Etherscan performs a 1/5s rate limit when using no API key, so this
adds a small random sleep to avoid the second test failing if it
executes fast enough.
pull/1556/head
Emilio López 2 years ago
parent 8d3aa94450
commit d72302f94c
  1. 5
      scripts/ci_test_etherscan.sh

@ -12,6 +12,11 @@ if ! slither 0x7F37f78cBD74481E593F9C737776F7113d76B315 --etherscan-apikey "$GIT
fi
echo "::endgroup::"
# Perform a small sleep when API key is not available (e.g. on PR CI from external contributor)
if [ "$GITHUB_ETHERSCAN" = "" ]; then
sleep $(( ( RANDOM % 5 ) + 1 ))s
fi
echo "::group::Etherscan rinkeby"
if ! slither rinkeby:0xFe05820C5A92D9bc906D4A46F662dbeba794d3b7 --etherscan-apikey "$GITHUB_ETHERSCAN"; then
echo "Etherscan rinkeby test failed"

Loading…
Cancel
Save