Skip to content

Commit

Permalink
Merge pull request #102 from xssnick/ticktock-fix
Browse files Browse the repository at this point in the history
Fixed TickTock tlb type in StateInit
  • Loading branch information
xssnick authored Feb 14, 2023
2 parents 46dbf5f + 618da30 commit bc389a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img align="right" width="425px" src="https://github.com/xssnick/props/blob/master/logoimg.png?raw=true">

[![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.

Expand Down
2 changes: 1 addition & 1 deletion tlb/state-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
22 changes: 12 additions & 10 deletions tlb/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit bc389a9

Please sign in to comment.