Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions test/scripts/e2e_subs/box-search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ ${gcmd} app call --from "$ACCOUNT" --app-id "$APPID" --app-arg "str:set" --app-a
cat "$TEMPDIR/box_create.txn" "$TEMPDIR/box_set.txn" > "$TEMPDIR/box_create_n_set.txn"
${gcmd} clerk group -i "$TEMPDIR/box_create_n_set.txn" -o "$TEMPDIR/box_group.txn"
${gcmd} clerk sign -i "$TEMPDIR/box_group.txn" -o "$TEMPDIR/box_group.stx"
${gcmd} clerk rawsend -f "$TEMPDIR/box_group.stx"
COMMIT=$(${gcmd} clerk rawsend -f "$TEMPDIR/box_group.stx" | grep "committed in round" | head -1 | awk '{print $6}')
echo "Last box made in $COMMIT"

echo "Confirm the NAME is $BOX_NAME"
${gcmd} app box info --app-id "$APPID" --name "$BOX_NAME"
Expand All @@ -136,10 +137,20 @@ NAME=$(${gcmd} app box info --app-id "$APPID" --name "$BOX_NAME" | grep Name | t
VALUE=$(${gcmd} app box info --app-id "$APPID" --name "$BOX_NAME" | grep Value | tr -s ' ' | cut -d" " -f2-)
[ "$VALUE" = str:$GREAT_VALUE ]

sleep 15 # again, app box list only hits DB

# Confirm that we can still get the list of boxes
BOX_LIST=$(${gcmd} app box list --app-id "$APPID")
# Confirm that we can still get the list of boxes (need to keep asking
# until the returned results are for $ROUND)
retry=0
while [ $retry -lt 10 ]; do
BOX_LIST=$(${gcmd} app box list --app-id "$APPID")
ROUND=$(echo "$BOX_LIST" | awk '/Round: / {print $2}')
if [[ "$COMMIT" == "$ROUND" ]]; then
break
fi
retry=$((retry + 1))
sleep 2
done

EXPECTED="Boxes:
b64:AQIDBA==
str:base64
Expand Down
Loading