-
Notifications
You must be signed in to change notification settings - Fork 6
/
easyrun.sh
executable file
·51 lines (41 loc) · 1 KB
/
easyrun.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
function print_available_contracts
{
for ff in tests/contracts/*
do
if [[ -d $ff && $ff != "tests/contracts/other" ]]
then
f=`basename $ff`
echo -n "$f|"
fi
done
}
function print_usage_and_exit
{
echo -n "Usage: $0 ["
print_available_contracts
echo "] test_number"
exit 1
}
if [ $# != 2 ]
then
print_usage_and_exit
fi
contract=$1
i=$2
cdir="$contract"
if [[ ! -d ${cdir} || ! -f ${cdir}/state_${i}.json ]]
then
echo "Test $contract $i does not exist"
print_usage_and_exit
fi
~/Desktop/Scilla/bin/scilla-runner -init ${cdir}/init.json -istate ${cdir}/state_${i}.json -imessage ${cdir}/message_${i}.json -o ${cdir}/output_${i}.json -iblockchain ${cdir}/blockchain_${i}.json -i ${cdir}/contract.scilla -libdir ~/Desktop/Scilla/src/stdlib -gaslimit 8000
status=$?
if test $status -eq 0
then
echo "output.json emitted by interpreter:"
cat ${cdir}/output_${i}.json
echo ""
else
echo "scilla-runner failed"
fi