Skip to content

Commit fdd17f3

Browse files
committed
🐛 Fix Nonce Default in --interactive Mode
Signed-off-by: Pascal Marco Caversaccio <[email protected]>
1 parent bb13053 commit fdd17f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

safe_hashes.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ calculate_safe_hashes() {
692692
local endpoint="${api_url}/api/v1/safes/${address}/multisig-transactions/?nonce=${nonce}"
693693

694694
# Get the Safe multisig version.
695-
local version=$(curl -sf "${api_url}/api/v1/safes/${address}/" | jq -r ".version // \"0.0.0\"")
695+
local version=$(curl -sf "${api_url}/api/v1/safes/${address}/" | jq -r ".version // \"0.0.0\"" || echo "0.0.0")
696696

697697
# If --interactive mode is enabled, the version value can be overridden by the user's input.
698698
if [[ -n "$interactive" ]]; then
@@ -736,7 +736,7 @@ EOF
736736
validate_value "$nonce" "nonce"
737737

738738
# Fetch the transaction data from the API.
739-
local response=$(curl -sf "$endpoint")
739+
local response=$(curl -sf "$endpoint" || echo "{}")
740740

741741
# Set the default index value for the transaction array.
742742
local idx=0
@@ -795,7 +795,6 @@ EOF
795795
local gas_price=$(echo "$response" | jq -r ".results[$idx].gasPrice // \"0\"")
796796
local gas_token=$(echo "$response" | jq -r ".results[$idx].gasToken // \"$ZERO_ADDRESS\"")
797797
local refund_receiver=$(echo "$response" | jq -r ".results[$idx].refundReceiver // \"$ZERO_ADDRESS\"")
798-
local nonce=$(echo "$response" | jq -r ".results[$idx].nonce // \"0\"")
799798
local data_decoded=$(echo "$response" | jq -r ".results[$idx].dataDecoded // \"0x\"")
800799

801800
# If --interactive mode is enabled, the parameter values can be overridden by the user's input.

0 commit comments

Comments
 (0)