File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,8 @@ ${gcmd} app call --from "$ACCOUNT" --app-id "$APPID" --app-arg "str:set" --app-a
126126cat " $TEMPDIR /box_create.txn" " $TEMPDIR /box_set.txn" > " $TEMPDIR /box_create_n_set.txn"
127127${gcmd} clerk group -i " $TEMPDIR /box_create_n_set.txn" -o " $TEMPDIR /box_group.txn"
128128${gcmd} clerk sign -i " $TEMPDIR /box_group.txn" -o " $TEMPDIR /box_group.stx"
129- ${gcmd} clerk rawsend -f " $TEMPDIR /box_group.stx"
129+ COMMIT=$( ${gcmd} clerk rawsend -f " $TEMPDIR /box_group.stx" | grep " committed in round" | head -1 | awk ' {print $6}' )
130+ echo " Last box made in $COMMIT "
130131
131132echo " Confirm the NAME is $BOX_NAME "
132133${gcmd} app box info --app-id " $APPID " --name " $BOX_NAME "
@@ -136,10 +137,20 @@ NAME=$(${gcmd} app box info --app-id "$APPID" --name "$BOX_NAME" | grep Name | t
136137VALUE=$( ${gcmd} app box info --app-id " $APPID " --name " $BOX_NAME " | grep Value | tr -s ' ' | cut -d" " -f2-)
137138[ " $VALUE " = str:$GREAT_VALUE ]
138139
139- sleep 15 # again, app box list only hits DB
140140
141- # Confirm that we can still get the list of boxes
142- BOX_LIST=$( ${gcmd} app box list --app-id " $APPID " )
141+ # Confirm that we can still get the list of boxes (need to keep asking
142+ # until the returned results are for $ROUND)
143+ retry=0
144+ while [ $retry -lt 10 ]; do
145+ BOX_LIST=$( ${gcmd} app box list --app-id " $APPID " )
146+ ROUND=$( echo " $BOX_LIST " | awk ' /Round: / {print $2}' )
147+ if [[ " $COMMIT " == " $ROUND " ]]; then
148+ break
149+ fi
150+ retry=$(( retry + 1 ))
151+ sleep 2
152+ done
153+
143154EXPECTED=" Boxes:
144155b64:AQIDBA==
145156str:base64
You can’t perform that action at this time.
0 commit comments