Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions test/scripts/e2e_subs/dynamic-fee-teal-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTC=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTD=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')
ACCOUNTC=$(${gcmd} account new|awk '{ print $6 }')
ACCOUNTD=$(${gcmd} account new|awk '{ print $6 }')
ZERO_ADDRESS=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ
LEASE=uImiLf+mqOqs0BFsqIUHBh436N/z964X50e3P9Ii4ac=

Expand Down
16 changes: 8 additions & 8 deletions test/scripts/e2e_subs/e2e_teal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')

# prints:
# Created new account with address UCTHHNBEAUWHDQWQI5DGQCTB7AR4CSVNU5YNPROAYQIT3Y3LKVDFAA5M6Q
ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')

ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
TIMEOUT_ROUND=$((${ROUND} + 7))
Expand All @@ -25,7 +25,7 @@ python ${GOPATH}/src/github.com/algorand/go-algorand/data/transactions/logic/tlh

cat ${TEMPDIR}/tlhc.teal

ACCOUNT_TLHC=$(${gcmd} clerk compile -n ${TEMPDIR}/tlhc.teal|tee /dev/tty|awk '{ print $2 }')
ACCOUNT_TLHC=$(${gcmd} clerk compile -n ${TEMPDIR}/tlhc.teal|awk '{ print $2 }')

${gcmd} clerk send --amount 1000000 --from ${ACCOUNT} --to ${ACCOUNT_TLHC}

Expand Down Expand Up @@ -63,10 +63,10 @@ set -e
${gcmd} clerk send --amount 1000000 --from ${ACCOUNT} --to ${ACCOUNT_TLHC}

# timeout round should pass. some of the 35 seconds was eaten by prior ops.
CROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
CROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
while [ $CROUND -lt $TIMEOUT_ROUND ]; do
goal node wait
CROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
CROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
done

${gcmd} clerk send --from-program ${TEMPDIR}/tlhc.teal --to ${ACCOUNT} --close-to ${ACCOUNT} --amount 1 --argb64 AA==
Expand All @@ -87,7 +87,7 @@ ${gcmd} clerk rawsend -f ${TEMPDIR}/one.stx

${gcmd} clerk dryrun -t ${TEMPDIR}/one.stx

ACCOUNT_TRUE=$(${gcmd} clerk compile -n ${TEMPDIR}/true.teal|tee /dev/tty|awk '{ print $2 }')
ACCOUNT_TRUE=$(${gcmd} clerk compile -n ${TEMPDIR}/true.teal|awk '{ print $2 }')

${gcmd} clerk send --amount 1000000 --from ${ACCOUNT} --to ${ACCOUNT_TRUE}

Expand All @@ -103,9 +103,9 @@ ${gcmd} clerk inspect ${TEMPDIR}/true.stx

${gcmd} clerk compile -D ${TEMPDIR}/true.lsig

ACCOUNTC=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTC=$(${gcmd} account new|awk '{ print $6 }')

ACCOUNTM=$(${gcmd} account multisig new -T 2 ${ACCOUNT} ${ACCOUNTB} ${ACCOUNTC}|tee /dev/tty|awk '{ print $6 }')
ACCOUNTM=$(${gcmd} account multisig new -T 2 ${ACCOUNT} ${ACCOUNTB} ${ACCOUNTC}|awk '{ print $6 }')


${gcmd} clerk multisig signprogram -p ${TEMPDIR}/true.teal -a ${ACCOUNT} -A ${ACCOUNTM} -o ${TEMPDIR}/mtrue.lsig
Expand Down
8 changes: 4 additions & 4 deletions test/scripts/e2e_subs/htlc-teal-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')
ZERO_ADDRESS=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ
LEASE=YmxhaCBibGFoIGxlYXNlIHdoYXRldmVyIGJsYWghISE=

# Generate the template
algotmpl -d ${GOPATH}/src/github.com/algorand/go-algorand/tools/teal/templates/ htlc --fee=2000 --hashfn="sha256" --hashimg="9S+9MrKzuG/4jvbEkGKChfSCrxXdyylUH5S89Saj9sc=" --own=${ACCOUNT} --rcv=${ACCOUNTB} --timeout=100000 > ${TEMPDIR}/atomic.teal

# Compile the template
CONTRACT=$(${gcmd} clerk compile ${TEMPDIR}/atomic.teal |tee /dev/tty| awk '{ print $2 }')
CONTRACT=$(${gcmd} clerk compile ${TEMPDIR}/atomic.teal | awk '{ print $2 }')

# Fund the contract
${gcmd} clerk send -a 10000000 -f ${ACCOUNT} -t ${CONTRACT}
Expand All @@ -45,7 +45,7 @@ fi
${gcmd} clerk send --fee=1000 --from-program ${TEMPDIR}/atomic.teal -a=0 -t=${ZERO_ADDRESS} --close-to=${ACCOUNTB} --argb64=aHVudGVyMg==

# Check balance
BALANCEB=$(${gcmd} account balance -a ${ACCOUNTB} |tee /dev/tty| awk '{ print $1 }')
BALANCEB=$(${gcmd} account balance -a ${ACCOUNTB} | awk '{ print $1 }')
if [ $BALANCEB -ne 9999000 ]; then
date '+htlc-teal-test FAIL wanted balance=9999000 but got ${BALANCEB} %Y%m%d_%H%M%S'
false
Expand Down
14 changes: 7 additions & 7 deletions test/scripts/e2e_subs/keyreg-teal-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNTA=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')
ACCOUNTA=$(${gcmd} account new|awk '{ print $6 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')
LEASE=YmxhaCBibGFoIGxlYXNlIHdoYXRldmVyIGJsYWghISE=

DUR=4
Expand Down Expand Up @@ -41,7 +41,7 @@ EOF
PBOUND=$(cat ${TEMPDIR}/pbound)
while [ ${ROUND} != ${PBOUND} ]; do
goal node wait
ROUND=$(goal node status |tee /dev/tty| grep 'Last committed block:'|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
done

echo "send a bad keyreg transaction (missing lease)"
Expand Down Expand Up @@ -89,7 +89,7 @@ ${gcmd} account changeonlinestatus -a ${ACCOUNTA} -x ${LEASE} --online --firstva
dsign ${TEMPDIR}/delegate.keyregkey ${TEMPDIR}/kr.lsig < ${TEMPDIR}/keyreg.tx > ${TEMPDIR}/keyreg.stx
${gcmd} clerk rawsend -f ${TEMPDIR}/keyreg.stx

REGOK=$(${gcmd} account list |tee /dev/tty| grep ${ACCOUNTA} | awk '{ print $1 }' | grep -c online)
REGOK=$(${gcmd} account list | grep ${ACCOUNTA} | awk '{ print $1 }' | grep -c online)
if [[ $REGOK != 1 ]]; then
date '+keyreg-teal-test FAIL correct keyreg transaction failed %Y%m%d_%H%M%S'
false
Expand Down Expand Up @@ -125,10 +125,10 @@ if [[ $RES != 'Participation key generation successful' ]]; then
fi

echo "wait for valid duration to pass"
ROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
while [ ${ROUND} -lt `expr ${EXPIRE} + 1` ]; do
goal node wait
ROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
done

echo "send a keyreg transaction after expiration"
Expand Down
10 changes: 5 additions & 5 deletions test/scripts/e2e_subs/limit-swap-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')
ZERO_ADDRESS=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ

${gcmd} asset create --creator ${ACCOUNT} --name bogocoin --unitname bogo --total 1000000000000
Expand All @@ -23,7 +23,7 @@ ASSET_ID=$(${gcmd} asset info --creator $ACCOUNT --asset bogo|grep 'Asset ID'|aw
echo "closeout part a, Algo trader"
# quick expiration, test closeout

ROUND=$(goal node status |tee /dev/tty| grep 'Last committed block:'|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
TIMEOUT_ROUND=$((${ROUND} + 2))

sed s/TMPL_ASSET/${ASSET_ID}/g < ${GOPATH}/src/github.com/algorand/go-algorand/tools/teal/templates/limit-order-a.teal.tmpl | sed s/TMPL_SWAPN/31337/g | sed s/TMPL_SWAPD/137/g | sed s/TMPL_TIMEOUT/${TIMEOUT_ROUND}/g | sed s/TMPL_OWN/${ACCOUNT}/g | sed s/TMPL_FEE/100000/g | sed s/TMPL_MINTRD/10000/g > ${TEMPDIR}/limit-order-a.teal
Expand Down Expand Up @@ -66,10 +66,10 @@ ${gcmd} clerk rawsend -f ${TEMPDIR}/b-asset-init.stx
echo "fund account with asset"
${gcmd} asset send --assetid ${ASSET_ID} -f ${ACCOUNT} -t ${ACCOUNT_ASSET_TRADER} -a 1000000

ROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
while [ $ROUND -lt $TIMEOUT_ROUND ]; do
goal node wait
ROUND=$(goal node status | grep 'Last committed block:'|tee /dev/tty|awk '{ print $4 }')
ROUND=$(goal node status | grep 'Last committed block:'|awk '{ print $4 }')
done

echo "recover asset"
Expand Down Expand Up @@ -116,7 +116,7 @@ echo "make Algo trader"

sed s/TMPL_ASSET/${ASSET_ID}/g < ${GOPATH}/src/github.com/algorand/go-algorand/tools/teal/templates/limit-order-a.teal.tmpl | sed s/TMPL_SWAPN/31337/g | sed s/TMPL_SWAPD/137/g | sed s/TMPL_TIMEOUT/${TIMEOUT_ROUND}/g | sed s/TMPL_OWN/${ACCOUNT}/g | sed s/TMPL_FEE/100000/g | sed s/TMPL_MINTRD/10000/g > ${TEMPDIR}/limit-order-a.teal

ACCOUNT_ALGO_TRADER=$(${gcmd} clerk compile ${TEMPDIR}/limit-order-a.teal -o ${TEMPDIR}/limit-order-a.tealc|tee /dev/tty|awk '{ print $2 }')
ACCOUNT_ALGO_TRADER=$(${gcmd} clerk compile ${TEMPDIR}/limit-order-a.teal -o ${TEMPDIR}/limit-order-a.tealc|awk '{ print $2 }')

echo "setup trader with Algos"
${gcmd} clerk send --amount 100000000 --from ${ACCOUNT} --to ${ACCOUNT_ALGO_TRADER}
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/e2e_subs/periodic-teal-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')
ZERO_ADDRESS=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ
LEASE=YmxhaCBibGFoIGxlYXNlIHdoYXRldmVyIGJsYWghISE=

sed s/TMPL_RCV/${ACCOUNTB}/g < ${GOPATH}/src/github.com/algorand/go-algorand/tools/teal/templates/periodic-payment-escrow.teal.tmpl | sed s/TMPL_PERIOD/5/g | sed s/TMPL_DUR/2/g | sed s/TMPL_AMT/1000000/g | sed s/TMPL_LEASE/${LEASE}/g | sed s/TMPL_TIMEOUT/16/g | sed s/TMPL_FEE/10000/g > ${TEMPDIR}/periodic.teal

ACCOUNT_PERIODIC=$(${gcmd} clerk compile ${TEMPDIR}/periodic.teal -o ${TEMPDIR}/periodic.tealc|tee /dev/tty|awk '{ print $2 }')
ACCOUNT_PERIODIC=$(${gcmd} clerk compile ${TEMPDIR}/periodic.teal -o ${TEMPDIR}/periodic.tealc|awk '{ print $2 }')

ROUND=5
DUR_ROUND=$((${ROUND} + 2))
Expand Down
12 changes: 6 additions & 6 deletions test/scripts/e2e_subs/teal-split-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ WALLET=$1

gcmd="goal -w ${WALLET}"

ACCOUNT=$(${gcmd} account list|tee /dev/tty|awk '{ print $3 }')
ACCOUNT=$(${gcmd} account list|awk '{ print $3 }')

ACCOUNTB=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTC=$(${gcmd} account new|tee /dev/tty|awk '{ print $6 }')
ACCOUNTB=$(${gcmd} account new|awk '{ print $6 }')
ACCOUNTC=$(${gcmd} account new|awk '{ print $6 }')

sed s/TMPL_RCV1/${ACCOUNTB}/g < ${GOPATH}/src/github.com/algorand/go-algorand/tools/teal/templates/split.teal.tmpl | sed s/TMPL_RCV2/${ACCOUNTC}/g | sed s/TMPL_RAT1/60/g | sed s/TMPL_RAT2/40/g | sed s/TMPL_MINPAY/100000/g | sed s/TMPL_TIMEOUT/4/g | sed s/TMPL_OWN/${ACCOUNTB}/g | sed s/TMPL_FEE/10000/g > ${TEMPDIR}/split.teal

ACCOUNT_SPLIT=$(${gcmd} clerk compile ${TEMPDIR}/split.teal -o ${TEMPDIR}/split.tealc|tee /dev/tty|awk '{ print $2 }')
ACCOUNT_SPLIT=$(${gcmd} clerk compile ${TEMPDIR}/split.teal -o ${TEMPDIR}/split.tealc|awk '{ print $2 }')

${gcmd} clerk send -a 60000000 -f $ACCOUNT_SPLIT -t $ACCOUNTB -o ${TEMPDIR}/b.tx
${gcmd} clerk send -a 40000000 -f $ACCOUNT_SPLIT -t $ACCOUNTC -o ${TEMPDIR}/c.tx
Expand All @@ -37,8 +37,8 @@ ${gcmd} clerk send -a 110000000 -f ${ACCOUNT} -t ${ACCOUNT_SPLIT}

${gcmd} clerk rawsend -f ${TEMPDIR}/group.stx

BALANCEB=$(${gcmd} account balance -a ${ACCOUNTB}|tee /dev/tty|awk '{ print $1 }')
BALANCEC=$(${gcmd} account balance -a ${ACCOUNTC}|tee /dev/tty|awk '{ print $1 }')
BALANCEB=$(${gcmd} account balance -a ${ACCOUNTB}|awk '{ print $1 }')
BALANCEC=$(${gcmd} account balance -a ${ACCOUNTC}|awk '{ print $1 }')

if [ $BALANCEB -ne 60000000 ]; then
echo bad balance B ${BALANCEB}
Expand Down