Skip to content

Commit

Permalink
fix: bad CLI arguments in some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
amusingaxl committed Aug 15, 2023
1 parent e88feb7 commit 7855d86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/cast-send.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ send() {

local RESPONSE
# Log the command being issued, making sure not to expose the password
log "cast send --json --keystore="$FOUNDRY_ETH_KEYSTORE_FILE" $(sed 's/ .*$/ [REDACTED]/' <<<"${PASSWORD_OPT[@]}")" $(printf ' %q' "$@")
log "cast send --json --keystore "$FOUNDRY_ETH_KEYSTORE_FILE" $(sed 's/ .*$/ [REDACTED]/' <<<"${PASSWORD_OPT[@]}")" $(printf ' %q' "$@")
# Currently `cast send` sends the logs to stdout instead of stderr.
# This makes it hard to compose its output with other commands, so here we are:
# 1. Duplicating stdout to stderr through `tee`
# 2. Extracting only the hash of the transaction to stdout
RESPONSE=$(cast send --json --keystore="$FOUNDRY_ETH_KEYSTORE_FILE" "${PASSWORD_OPT[@]}" "$@" | tee >(cat 1>&2))
RESPONSE=$(cast send --json --keystore "$FOUNDRY_ETH_KEYSTORE_FILE" "${PASSWORD_OPT[@]}" "$@" | tee >(cat 1>&2))

jq -Rr 'fromjson? | .transactionHash' <<<"$RESPONSE"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/forge-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ run_script() {
# This makes it hard to compose its output with other commands, so here we are:
# 1. Duplicating stdout to stderr through `tee`
# 2. Extracting only the address of the deployed contract to stdout
RESPONSE=$(forge script --json --sender "$FOUNDRY_ETH_FROM" --keystores "$FOUNDRY_ETH_KEYSTORE_FILE" "${PASSWORD_OPT[@]}" "$@" | tee >(cat 1>&2))
RESPONSE=$(forge script --json --sender "$FOUNDRY_ETH_FROM" --keystore "$FOUNDRY_ETH_KEYSTORE_FILE" "${PASSWORD_OPT[@]}" "$@" | tee >(cat 1>&2))

jq -Rr 'fromjson?' <<<"$RESPONSE"
}
Expand Down

0 comments on commit 7855d86

Please sign in to comment.