Skip to content

Commit

Permalink
Add build.sh and test.sh scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
raiym committed Feb 22, 2020
1 parent acb3760 commit 7cbdd65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
9 changes: 9 additions & 0 deletions smartcontract/build.sh
@@ -0,0 +1,9 @@
#!/bin/bash

~/TON/build/crypto/func -SPA -R -o lottery-compiled.fif ~/TON/ton/crypto/smartcont/stdlib.fc ./lottery-code.fc

cp lottery-compiled.fif lottery-compiled-for-test.fif
sed '$d' lottery-compiled-for-test.fif > test.fif
rm lottery-compiled-for-test.fif
mv test.fif lottery-compiled-for-test.fif
echo -n "}END>s constant code" >> lottery-compiled-for-test.fif
26 changes: 1 addition & 25 deletions smartcontract/lottery-test-suite.fif
@@ -1,30 +1,6 @@
"TonUtil.fif" include
"Asm.fif" include
// automatically generated from `./stdlib.fc` `./lottery-code.fc`
PROGRAM{
DECLPROC recv_internal
DECLPROC recv_external
recv_internal PROC:<{
// in_msg
DROP //
}>
recv_external PROC:<{
// in_msg
DUP // in_msg in_msg
SEMPTY // in_msg _1
IFJMP:<{ // in_msg
DROP //
}> // in_msg
32 LDU // _17 _16
DROP // msg_seqno
c4 PUSH // msg_seqno _7
CTOS // msg_seqno ds
32 LDU // msg_seqno _19 _18
DROP // msg_seqno stored_seqno
EQUAL // _14
33 THROWIFNOT
}>
}END>s constant code
"lottery-compiled-for-test.fif" include

0 tuple 0x076ef1ea , // magic
0 , 0 , // actions msg_sents
Expand Down
8 changes: 8 additions & 0 deletions smartcontract/test.sh
@@ -0,0 +1,8 @@
#!/bin/bash

./build.sh

echo "\nCompilation completed\n"

export FIFTPATH=~/TON/ton/crypto/fift/lib
~/TON/build/crypto/fift -s lottery-test-suite.fif

0 comments on commit 7cbdd65

Please sign in to comment.