From d8d9b17a8c4358d6e52800a0b26d2976536e21f6 Mon Sep 17 00:00:00 2001 From: Oleg Baranov Date: Tue, 14 Feb 2023 10:56:22 +0400 Subject: [PATCH 1/2] Fixed TickTock tlb type in StateInit --- tlb/state-init.go | 2 +- tlb/transaction.go | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tlb/state-init.go b/tlb/state-init.go index 20e7056e..292e696e 100644 --- a/tlb/state-init.go +++ b/tlb/state-init.go @@ -13,7 +13,7 @@ type TickTock struct { type StateInit struct { Depth uint64 `tlb:"maybe ## 5"` - TickTock *TickTock `tlb:"maybe ^"` + TickTock *TickTock `tlb:"maybe ."` Code *cell.Cell `tlb:"maybe ^"` Data *cell.Cell `tlb:"maybe ^"` Lib *cell.Dictionary `tlb:"dict 256"` diff --git a/tlb/transaction.go b/tlb/transaction.go index 2884ec99..31807edc 100644 --- a/tlb/transaction.go +++ b/tlb/transaction.go @@ -53,18 +53,20 @@ func (t *Transaction) String() string { } } - if t.IO.In.MsgType == MsgTypeInternal { - in = t.IO.In.AsInternal().Amount.NanoTON() - } - var build string - if in.Cmp(big.NewInt(0)) != 0 { - intTx := t.IO.In.AsInternal() - build += fmt.Sprintf("LT: %d, In: %s TON, From %s", t.LT, FromNanoTON(in).TON(), intTx.SrcAddr) - comment := intTx.Comment() - if comment != "" { - build += ", Comment: " + comment + if t.IO.In != nil { + if t.IO.In.MsgType == MsgTypeInternal { + in = t.IO.In.AsInternal().Amount.NanoTON() + } + + if in.Cmp(big.NewInt(0)) != 0 { + intTx := t.IO.In.AsInternal() + build += fmt.Sprintf("LT: %d, In: %s TON, From %s", t.LT, FromNanoTON(in).TON(), intTx.SrcAddr) + comment := intTx.Comment() + if comment != "" { + build += ", Comment: " + comment + } } } From 618da30741d28e431e44cfc2cd2812c7cd996f27 Mon Sep 17 00:00:00 2001 From: Coverage Date: Tue, 14 Feb 2023 06:58:44 +0000 Subject: [PATCH 2/2] Updated coverage badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3aa8f977..f119428c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Based on TON][ton-svg]][ton] -![Coverage](https://img.shields.io/badge/Coverage-72.2%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-72.4%25-brightgreen) Golang library for interacting with TON blockchain.