From 3a23954519471f5b3e017cc0e00b7c97d1092f0e Mon Sep 17 00:00:00 2001 From: Alexey Kostenko Date: Thu, 26 Sep 2024 19:34:11 +0300 Subject: [PATCH] int fix --- tlb/integers.go | 17 +++++++++++++---- tlb/parser/builtin_generator.go | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tlb/integers.go b/tlb/integers.go index 67cc2b9f..750c06a4 100644 --- a/tlb/integers.go +++ b/tlb/integers.go @@ -1,16 +1,17 @@ package tlb -// Code autogenerated. DO NOT EDIT. + +// Code autogenerated. DO NOT EDIT. import ( "encoding/hex" "fmt" "math/big" - "strings" "strconv" + "strings" "github.com/tonkeeper/tongo/boc" ) - + type VarUInteger1 big.Int func (u VarUInteger1) MarshalTLB(c *boc.Cell, encoder *Encoder) error { @@ -5943,6 +5944,9 @@ func (u Int128) MarshalTLB(c *boc.Cell, encoder *Encoder) error { func (u *Int128) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { v, err := c.ReadBigInt(128) + if err != nil { + return err + } *u = Int128(*v) return err } @@ -6010,6 +6014,9 @@ func (u Int256) MarshalTLB(c *boc.Cell, encoder *Encoder) error { func (u *Int256) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { v, err := c.ReadBigInt(256) + if err != nil { + return err + } *u = Int256(*v) return err } @@ -6077,6 +6084,9 @@ func (u Int257) MarshalTLB(c *boc.Cell, encoder *Encoder) error { func (u *Int257) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { v, err := c.ReadBigInt(257) + if err != nil { + return err + } *u = Int257(*v) return err } @@ -6309,4 +6319,3 @@ func (u Bits512) Equal(other any) bool { } return u == otherBits } - \ No newline at end of file diff --git a/tlb/parser/builtin_generator.go b/tlb/parser/builtin_generator.go index 9b55c6b2..bf5c4930 100644 --- a/tlb/parser/builtin_generator.go +++ b/tlb/parser/builtin_generator.go @@ -230,6 +230,9 @@ func (u Int{{.NameIndex}}) MarshalTLB(c *boc.Cell, encoder *Encoder) error { func (u *Int{{.NameIndex}}) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { v, err := c.ReadBigInt({{.NameIndex}}) + if err != nil { + return err + } *u = Int{{.NameIndex}}(*v) return err }