ligo/test/test_basic.sh

58 lines
1.7 KiB
Bash
Raw Normal View History

2017-07-24 17:06:56 +04:00
#!/bin/bash
2016-09-08 21:13:10 +04:00
set -e
2017-08-04 20:32:11 +04:00
source test_utils.sh
2016-09-08 21:13:10 +04:00
2017-08-09 18:09:41 +04:00
start_sandboxed_node
sleep 3
activate_alpha
add_bootstrap_identities
2017-07-24 17:06:56 +04:00
${TZCLIENT} list known identities
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} transfer 1000 from bootstrap1 to ${KEY1}
${TZCLIENT} transfer 2000 from bootstrap1 to ${KEY2}
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} get balance for ${KEY1} | assert "1,000.00 ꜩ"
${TZCLIENT} get balance for ${KEY2} | assert "2,000.00 ꜩ"
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} transfer 1000 from ${KEY2} to ${KEY1}
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} get balance for ${KEY1} | assert "2,000.00 ꜩ"
${TZCLIENT} get balance for ${KEY2} | assert "999.95 ꜩ"
2016-09-08 21:13:10 +04:00
# Should fail
2017-07-24 17:06:56 +04:00
# ${TZCLIENT} transfer 999.95 from ${KEY2} to ${KEY1}
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} mine for bootstrap1
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} remember program noop file:contracts/noop.tz
${TZCLIENT} typecheck program noop
${TZCLIENT} originate contract noop \
2017-05-07 07:53:09 +04:00
for ${KEY1} transferring 1000 from bootstrap1 \
2016-09-08 21:13:10 +04:00
running noop
2017-07-24 17:06:56 +04:00
${TZCLIENT} transfer 10 from bootstrap1 to noop -arg "Unit"
2016-09-08 21:13:10 +04:00
2017-07-24 17:06:56 +04:00
${TZCLIENT} originate contract hardlimit \
2017-05-07 07:53:09 +04:00
for ${KEY1} transferring 1000 from bootstrap1 \
2017-07-24 17:06:56 +04:00
running file:contracts/hardlimit.tz -init "3"
${TZCLIENT} transfer 10 from bootstrap1 to hardlimit -arg "Unit"
${TZCLIENT} transfer 10 from bootstrap1 to hardlimit -arg "Unit"
# ${TZCLIENT} transfer 10 from bootstrap1 to hardlimit -arg "unit" # should fail
${TZCLIENT} originate free account free_account for ${KEY1}
${TZCLIENT} get delegate for free_account
${TZCLIENT} set delegate for free_account to ${KEY2}
${TZCLIENT} get delegate for free_account
2017-05-19 07:14:14 +04:00
${TZCLIENT} get balance for bootstrap5 | assert "4,000,000.00 ꜩ"
${TZCLIENT} transfer 4000000.00 from bootstrap5 to bootstrap1 -fee 0
${TZCLIENT} transfer 4000000.00 from bootstrap1 to bootstrap5 -fee 0
${TZCLIENT} get balance for bootstrap5 | assert "4,000,000.00 ꜩ"
2016-09-08 21:13:10 +04:00
echo
echo End of test
echo