Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth: fix unbound variable errors in shell utilities #4103

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ethereum/anvil_fork
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ set -euo pipefail
# This script forks a chain using anvil with the mnemonic that is used in the
# testing environment.

if [ -z "$1" ]; then
CHAIN_NAME="${1:-}"

if [ -z "$CHAIN_NAME" ]; then
echo "Usage: $0 <chain name>" >&2
exit 1
fi

CHAIN_NAME="$1"

DOCKER_ARGS="-p 8545:8545" ./foundry anvil --host 0.0.0.0 --base-fee 0 --fork-url $(worm info rpc mainnet $CHAIN_NAME) --mnemonic "myth like bonus scare over problem client lizard pioneer submit female collect"
22 changes: 18 additions & 4 deletions ethereum/sh/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@

set -euo pipefail

network=$1
module=$2
chain=$3
network="${1:-}"
module="${2:-}"
chain="${3:-}"

if [ -z "$network" ] || [ -z "$module" ] || [ -z "$chain" ]; then
echo "Usage: MNEMONIC=... $0 <network> <module> <chain name>" >&2
exit 1
fi

if [ -z "${MNEMONIC:-}" ]; then
echo "MNEMONIC unset"
exit 1
fi

secret=$MNEMONIC
guardian_secret=""

if [ "$network" = testnet ]; then
if [ -z "${GUARDIAN_MNEMONIC:-}" ]; then
echo "GUARDIAN_MNEMONIC unset"
exit 1
fi
guardian_secret=$GUARDIAN_MNEMONIC
fi

Expand Down Expand Up @@ -114,4 +128,4 @@ if [ "$network" = testnet ]; then
worm submit $(worm generate upgrade -c "$chain" -a "$new_implementation" -m "$module" -g "$guardian_secret") -n "$network"
else
echo "../scripts/contract-upgrade-governance.sh -c $chain -m $verify_module -a $new_implementation"
fi
fi
2 changes: 1 addition & 1 deletion ethereum/sh/upgrade_all_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -uo pipefail
network=testnet

for module in ${MODULES[@]}; do
for chain in ${chains[@]}; do
for chain in ${CHAINS[@]}; do
echo "Upgrading ${chain} ${module} ********************************************************************"
./sh/upgrade.sh "$network" "$module" "$chain"
done
Expand Down
Loading