Skip to content

Commit

Permalink
Fix anvil devchain generation (#11226)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazarre authored Sep 25, 2024
1 parent 736fbc2 commit aa7b9bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/protocol/scripts/foundry/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export L2_DEVCHAIN_FILE_NAME="l2-devchain.json" # Name of the file that will be
export TMP_FOLDER="$PWD/.tmp"
export TEMP_DIR="$PWD/.tmp/libraries"
export ANVIL_FOLDER="$TMP_FOLDER/devchain"
export SLEEP_DURATION=20

# Contract addresses
export REGISTRY_ADDRESS="0x000000000000000000000000000000000000ce10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo "Migration script total elapsed time: $ELAPSED_TIME seconds"

# this helps to make sure that devchain state is actually being saved
sleep 1
sleep $SLEEP_DURATION

if [[ "${KEEP_DEVCHAIN_FOLDER:-}" == "true" ]]; then
cp $ANVIL_FOLDER/state.json $TMP_FOLDER/$L1_DEVCHAIN_FILE_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ forge script \
$NON_INTERACTIVE \
--rpc-url $ANVIL_RPC_URL || { echo "Migration script failed"; exit 1; }

# Give anvil enough time to save the state
sleep $SLEEP_DURATION

# # Save L2 state so it can published to NPM
mv $ANVIL_FOLDER/state.json $TMP_FOLDER/$L2_DEVCHAIN_FILE_NAME
echo "Saved anvil L2 state to $TMP_FOLDER/$L2_DEVCHAIN_FILE_NAME"
Expand Down

0 comments on commit aa7b9bb

Please sign in to comment.