From 7cbdd65de60292148421c89221f9f8f05bedbc23 Mon Sep 17 00:00:00 2001 From: Raiymbek Kapishev Date: Sat, 22 Feb 2020 20:33:05 +0400 Subject: [PATCH] Add build.sh and test.sh scripts --- smartcontract/build.sh | 9 +++++++++ smartcontract/lottery-test-suite.fif | 26 +------------------------- smartcontract/test.sh | 8 ++++++++ 3 files changed, 18 insertions(+), 25 deletions(-) create mode 100755 smartcontract/build.sh create mode 100755 smartcontract/test.sh diff --git a/smartcontract/build.sh b/smartcontract/build.sh new file mode 100755 index 0000000..822a2ee --- /dev/null +++ b/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 diff --git a/smartcontract/lottery-test-suite.fif b/smartcontract/lottery-test-suite.fif index 529b56b..eeebd6e 100644 --- a/smartcontract/lottery-test-suite.fif +++ b/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 diff --git a/smartcontract/test.sh b/smartcontract/test.sh new file mode 100755 index 0000000..7309ccb --- /dev/null +++ b/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