Skip to content

Commit

Permalink
Change the way transaction hash is extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Sep 12, 2024
1 parent 950bdc8 commit 1235123
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/helpers/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function sendTx() {
return 1
fi

echo "Sending smart contract transaction (RPC URL: $rpc_url, sender: $senderAddr) to $receiver with function signature: $value_or_function_sig and params: ${params[*]}"
echo "Sending smart contract transaction (RPC URL: $rpc_url, sender: $senderAddr) to $receiver with function signature: '$value_or_function_sig' and params: ${params[*]}"

# Send the smart contract interaction using cast
cast_output=$(cast send --rpc-url "$rpc_url" \
Expand All @@ -134,8 +134,7 @@ function sendTx() {
fi

# Extract the transaction hash from the output
local tx_hash
tx_hash=$(echo "$cast_output" | grep 'transactionHash' | sed 's/transactionHash\s\+//')
local tx_hash=$(echo "$cast_output" | grep -m 1 'transactionHash' | awk '{print $2}')
echo "Tx hash: $tx_hash"

if [[ -z "$tx_hash" ]]; then
Expand Down

0 comments on commit 1235123

Please sign in to comment.