File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22set -euo pipefail
33
44run_txn () {
5- local desc=" $1 "
5+ desc=$1
66 shift
7-
87 echo " >>> $desc "
8+ result=$( flow transactions send " $@ " 2>&1 || true)
99
10- # Capture output AND whether the CLI itself failed
11- local result status=0
12- result=" $( flow transactions send " $@ " 2>&1 ) " || status=$?
13-
14- # Always show the Flow output
1510 echo " $result "
1611
17- # If the CLI failed (network, auth, etc.)
18- if [[ $status -ne 0 ]]; then
19- echo " ❌ Transaction '$desc ' failed (flow CLI error, exit $status )"
20- exit 1
21- fi
22-
23- # Must be SEALED
24- if ! echo " $result " | grep -qE ' Status[[:space:]]+✅[[:space:]]+SEALED|(^|[[:space:]])SEALED($|[[:space:]])' ; then
12+ if ! echo " $result " | grep -q " SEALED" ; then
2513 echo " ❌ Transaction '$desc ' failed (not SEALED)"
2614 exit 1
2715 fi
28-
29- # Detect execution errors even when SEALED
30- if echo " $result " | grep -qiE \
31- ' (^|[[:space:]])❌[[:space:]]*Transaction Error|(^|[[:space:]])Transaction Error|cadence runtime error|error:[[:space:]]+panic|error:[[:space:]]+assertion failed|\[Error Code:' ; then
32- echo " ❌ Transaction '$desc ' failed (execution error detected despite SEALED)"
16+ if echo " $result " | grep -q " Transaction Error" ; then
17+ echo " ❌ Transaction '$desc ' failed (Error)"
3318 exit 1
3419 fi
35-
36- echo " ✅ '$desc ' succeeded."
37- }}
20+ }
3821
3922run_txn " Grant Tide Beta access to test user" \
4023 ./cadence/transactions/flow-vaults/admin/grant_beta.cdc \
You can’t perform that action at this time.
0 commit comments