From 45accdf9e7db2ee1949d54913164042376e61292 Mon Sep 17 00:00:00 2001 From: Victoria Erokhina Date: Thu, 3 Oct 2024 19:51:53 +0000 Subject: [PATCH 1/2] replace to MessageRelaxed in risks extraction --- pkg/wallet/risk.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/wallet/risk.go b/pkg/wallet/risk.go index e3b00419..89b23bf3 100644 --- a/pkg/wallet/risk.go +++ b/pkg/wallet/risk.go @@ -40,23 +40,17 @@ func ExtractRiskFromRawMessages(rawMessages []tongoWallet.RawMessage) (*Risk, er if tongoWallet.IsMessageModeSet(int(rawMsg.Mode), tongoWallet.AttachAllRemainingBalance) { risk.TransferAllRemainingBalance = true } - var m tlb.Message + var m abi.MessageRelaxed if err := tlb.Unmarshal(rawMsg.Message, &m); err != nil { return nil, err } - var err error - var tonValue uint64 - var destination *tongo.AccountID - if m.Info.IntMsgInfo != nil { - tonValue = uint64(m.Info.IntMsgInfo.Value.Grams) - destination, err = ton.AccountIDFromTlb(m.Info.IntMsgInfo.Dest) - if err != nil { - return nil, err - } + tonValue := uint64(m.MessageInternal.Value.Grams) + destination, err := ton.AccountIDFromTlb(m.MessageInternal.Dest) + if err != nil { + return nil, err } risk.Ton += tonValue - body := boc.Cell(m.Body.Value) - _, _, msgBody, err := abi.InternalMessageDecoder(&body, nil) + msgBody := m.MessageInternal.Body.Value.Value if err != nil { continue } From 281cbe3d97e9b2d7499e89b17ef652f49faf76d2 Mon Sep 17 00:00:00 2001 From: Victoria Erokhina Date: Thu, 3 Oct 2024 21:03:07 +0000 Subject: [PATCH 2/2] update tongo --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 336c96f7..17feeea2 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/sourcegraph/conc v0.3.0 github.com/stretchr/testify v1.9.0 github.com/tonkeeper/scam_backoffice_rules v0.0.0-20240812140315-a2b21a866ae6 - github.com/tonkeeper/tongo v1.10.0 + github.com/tonkeeper/tongo v1.10.2 go.opentelemetry.io/otel v1.24.0 go.opentelemetry.io/otel/metric v1.24.0 go.opentelemetry.io/otel/trace v1.24.0 diff --git a/go.sum b/go.sum index 01816b56..b05e44ed 100644 --- a/go.sum +++ b/go.sum @@ -272,8 +272,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tonkeeper/scam_backoffice_rules v0.0.0-20240812140315-a2b21a866ae6 h1:2/A4HLpyu4qFmjtHfAU3Iu9kFrdM9lQJtkyWR2BRlX8= github.com/tonkeeper/scam_backoffice_rules v0.0.0-20240812140315-a2b21a866ae6/go.mod h1:SqZXYO9vbID8ku+xnnaKXeNGmehxigODGrk5V1KqbRA= -github.com/tonkeeper/tongo v1.10.0 h1:EsuZSw+ZBxCfB/lTZaUPp0/Mr5zPQCvA8T48QKwMgeI= -github.com/tonkeeper/tongo v1.10.0/go.mod h1:MjgIgAytFarjCoVjMLjYEtpZNN1f2G/pnZhKjr28cWs= +github.com/tonkeeper/tongo v1.10.2 h1:vlEne15Kl+bmY2i40Us28uDjIRbgfpk1P+tp8jNWu4s= +github.com/tonkeeper/tongo v1.10.2/go.mod h1:MjgIgAytFarjCoVjMLjYEtpZNN1f2G/pnZhKjr28cWs= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=