Skip to content

Commit

Permalink
replace to MessageRelaxed in risks extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
erokhinav committed Oct 3, 2024
1 parent 39c73cc commit 45accdf
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pkg/wallet/risk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 45accdf

Please sign in to comment.