1
0
mirror of https://github.com/danog/toncontest.git synced 2024-11-30 04:29:14 +01:00
This commit is contained in:
Daniil Gentili 2019-10-15 00:23:58 +02:00
parent d902bc1ec3
commit 496cd2279d
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
4 changed files with 79 additions and 76 deletions

View File

@ -18,7 +18,7 @@ This will automatically build the lite client, fift and func, and will also edit
## Contents
* `toolchain` - Some automatic builder scripts and wrappers around the funC compiler and fift
* `toolchain` - Some automatic builder scripts and wrappers around the funC compiler and fift, along with tweaked zerostate generator and testgiver scripts
* `wallet` - Advanced upgradable multisignature wallet
* `test` - A small bugreport about issues with fift exception traces
* [GitHub issues and bugreports](https://github.com/ton-blockchain/ton/issues?utf8=%E2%9C%93&q=author%3Adanog+):

View File

@ -6,7 +6,7 @@ Upgradable multisignature wallet, with custom scripts to deserialize and inspect
All custom data structures used in the wallet can be viewed as a custom TL-B scheme in `proto/scheme.tlb` (some basic TON constructors are also included for reference).
Most smart contact get-methods (except for the basic seqno and getPartials methods) return an integer, indicating whether the operation was successful and the requested data was found, followed by a cell/integer with the found data (or an empty cell/0 in case of failure).
I created a full testing platform with a collator emulator in FIFT that parses the generated external messages and runs the required logic (including code and data initialization from the StateInit of constructor messages, with support for multiple consecutive method calls and data persistence) in the TVM, partially emulating the logic of `Transaction::unpack_input_msg` and `Collator::create_ordinary_transaction`.
I created a full testing platform with a collator emulator in FIFT that parses the generated external messages and runs the required logic (including code and data initialization from the StateInit of constructor messages, with support for multiple consecutive method calls and data persistence) in the TVM, partially emulating the logic of `Transaction::unpack_input_msg` and `Collator::create_ordinary_transaction`, also allowing us to run get-methods.
I've tested throughly the smart contract using my local collator emulator (`test.fif`), and the actual TON collator using a slightly tweaked [zerostate generator](https://github.com/ton-blockchain/ton/pull/145) and the custom `test-collator.sh` script.
@ -104,7 +104,7 @@ Scripts:
## Testing
The `test.sh` script contains a full set of commands to test every fift script.
You might want to run each command inside `test.sh` separately (there are also multiple comments explaining what each line does in detail), or run `./test.sh | less` to be able to better review the output of each command.
You might want to run each command inside `test.sh` separately (there are also multiple comments explaining what each line does in detail).
What follows is a line-by-line description of the actions in `test.sh`.

View File

@ -5,7 +5,7 @@ chr() { [ "$1" -lt 256 ] || return 1; printf "\\$(printf '%03o' "$1")"; }
ord() { LC_CTYPE=C printf '%d' "'$1"; }
cd tests
{
# Sign previous simple wallet query (a, b) with key c (a, b, c)
fift -s ../sign.fif b abc c 2
@ -45,3 +45,4 @@ fift -s ../test.fif \
0 113609 \
code-update-merge -1 \
abc -1
} 2>&1 | less -R

View File

@ -4,6 +4,7 @@
chr() { [ "$1" -lt 256 ] || return 1; printf "\\$(printf '%03o' "$1")"; }
ord() { LC_CTYPE=C printf '%d' "'$1"; }
{
mkdir -p tests
cd tests
# Create 10 public keys
@ -53,3 +54,4 @@ fift -s ../test.fif \
0 113609 \
merge -1 \
0 113609
} 2>&1 | less -R