diff --git a/wallet/test.fif b/wallet/test.fif index 0b0dd76..8447260 100644 --- a/wallet/test.fif +++ b/wallet/test.fif @@ -3,12 +3,13 @@ ' constant : const { file>B B>boc } : load-boc { - ."usage: " @' $0 type ." " cr - ."Runs the TON VM, using code and storage data from .boc and .boc as message." cr 1 halt + ."usage: " @' $0 type ." " cr + ."Runs the function with ID in the TON VM, using code and storage data from .boc and .boc as message." cr 1 halt } : usage $# 2 < ' usage if -$1 +".boc" load-boc const message +$1 +".boc" load-boc const message-boc $2 +".boc" load-boc const init-boc +$3 parse-int const function // message$_ {X:Type} info:CommonMsgInfo // init:(Maybe (Either StateInit ^StateInit)) @@ -43,15 +44,15 @@ init-boc { ."There seems to be an invalid header" cr } if // 1000100 => 68 @@ -65,7 +66,13 @@ message hash 5 tuple 1 tuple constant ctx + +message function code storage ctx .s runvmctx \ No newline at end of file diff --git a/wallet/wallet-code.fc b/wallet/wallet-code.fc index 8232344..589b7da 100644 --- a/wallet/wallet-code.fc +++ b/wallet/wallet-code.fc @@ -121,7 +121,7 @@ builder store_keys(builder b, int length, var keys) { ;; multiSigWrapper$0 keys_signatures:(HashmapE 4 Signature) message:(WrappedMessage X) = MultiSigWrapper X; () recv_external(slice in_msg) impure { ;; Check if multiSigWrapper$0 or future unsupported protocol - throw_unless(32, in_msg~load_uint(1)); + throw_if(32, in_msg~load_uint(1)); ;; Check if is hme_empty$0 or hme_root$1 ;; Throw if empty signature list diff --git a/wallet/wallet-code.fif b/wallet/wallet-code.fif index b124849..a7d850c 100644 --- a/wallet/wallet-code.fif +++ b/wallet/wallet-code.fif @@ -15,6 +15,7 @@ PROGRAM{ 124239 DECLMETHOD getPartials 87848 DECLMETHOD getPartialsById 110845 DECLMETHOD getPartialsByKey + 73634 DECLMETHOD getPartialsByHash ~collect_garbage PROC:<{ -1 PUSHINT UNTIL:<{ @@ -193,7 +194,7 @@ PROGRAM{ recv_external PROC:<{ 1 LDU SWAP - 32 THROWIFNOT + 32 THROWIF DUP 1 PLDU 33 THROWIFNOT @@ -455,4 +456,14 @@ PROGRAM{ }> getPartialsById CALLDICT }> + getPartialsByHash PROC:<{ + c4 PUSH + CTOS + 36 PUSHINT + SDSKIPFIRST + skip_keys CALLDICT + PLDDICT + 8 PUSHPOW2 + DICTUGETOPTREF + }> }END>c diff --git a/wallet/wallet-create.fif b/wallet/wallet-create.fif index 9b7c820..851f5fc 100644 --- a/wallet/wallet-create.fif +++ b/wallet/wallet-create.fif @@ -149,6 +149,12 @@ dup hash wc swap 2dup 2constant wallet_addr dup ."signing message: " dup ."External message for initialization is " B dup Bx. cr