Skip to content

Commit

Permalink
Add state init to jetton transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed Sep 27, 2024
1 parent 3a23954 commit fa4e5f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contract/jetton/jetton.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type TransferMessage struct {
ForwardTonAmount tlb.Grams
ForwardPayload *boc.Cell
CustomPayload *boc.Cell
StateInit *tlb.StateInit
}

func (tm TransferMessage) ToInternal() (tlb.Message, uint8, error) {
Expand Down Expand Up @@ -73,6 +74,14 @@ func (tm TransferMessage) ToInternal() (tlb.Message, uint8, error) {
Mode: wallet.DefaultMessageMode,
Body: c,
}
if tm.StateInit != nil {
if tm.StateInit.Code.Exists {
m.Code = &tm.StateInit.Code.Value.Value
}
if tm.StateInit.Data.Exists {
m.Data = &tm.StateInit.Data.Value.Value
}
}
return m.ToInternal()
}

Expand Down

0 comments on commit fa4e5f1

Please sign in to comment.