diff --git a/README.md b/README.md index 6a5c3451..718a7c87 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Based on TON][ton-svg]][ton] -![Coverage](https://img.shields.io/badge/Coverage-73.8%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-73.7%25-brightgreen) Golang library for interacting with TON blockchain. diff --git a/example/highload-wallet/main.go b/example/highload-wallet/main.go index 8db34934..3bb8f32e 100644 --- a/example/highload-wallet/main.go +++ b/example/highload-wallet/main.go @@ -86,10 +86,11 @@ func main() { messages = append(messages, &wallet.Message{ Mode: 1 + 2, // pay fee separately, ignore action errors InternalMessage: &tlb.InternalMessage{ - Bounce: addr.IsBounceable(), - DstAddr: addr, - Amount: tlb.MustFromTON(amtStr), - Body: comment, + IHRDisabled: true, // disable hyper routing (currently not works in ton) + Bounce: addr.IsBounceable(), + DstAddr: addr, + Amount: tlb.MustFromTON(amtStr), + Body: comment, }, }) } diff --git a/tlb/loader.go b/tlb/loader.go index f1dd90bf..ecbc5dea 100644 --- a/tlb/loader.go +++ b/tlb/loader.go @@ -578,6 +578,14 @@ func storeField(settings []string, root *cell.Builder, structField reflect.Struc asRef := false if settings[0] == "^" { + if cellType == parseType { + // store cell as ref directly + if err := root.StoreRef(fieldVal.Interface().(*cell.Cell)); err != nil { + return fmt.Errorf("failed to store cell to ref for %s, err: %w", structField.Name, err) + } + return nil + } + asRef = true settings = settings[1:] builder = cell.BeginCell() diff --git a/ton/wallet/integration_test.go b/ton/wallet/integration_test.go index 6767edc7..35bcc357 100644 --- a/ton/wallet/integration_test.go +++ b/ton/wallet/integration_test.go @@ -183,7 +183,7 @@ func Test_WalletFindTransactionByInMsgHash(t *testing.T) { } // wait next block to be sure everything updated - block, err = api.WaitForBlock(block.SeqNo + 2).GetMasterchainInfo(ctx) + block, err = api.WaitForBlock(block.SeqNo + 3).GetMasterchainInfo(ctx) if err != nil { t.Fatal("wait master err:", err.Error()) } diff --git a/tvm/cell/dict.go b/tvm/cell/dict.go index ccd82e91..3d018a9c 100644 --- a/tvm/cell/dict.go +++ b/tvm/cell/dict.go @@ -74,6 +74,17 @@ func (c *Slice) LoadDict(keySz uint) (*Dictionary, error) { return cl.ToDict(keySz) } +func (d *Dictionary) GetKeySize() uint { + return d.keySz +} + +func (d *Dictionary) Copy() *Dictionary { + return &Dictionary{ + keySz: d.keySz, + root: d.root, + } +} + func (d *Dictionary) SetIntKey(key *big.Int, value *Cell) error { return d.Set(BeginCell().MustStoreBigInt(key, d.keySz).EndCell(), value) }