Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/state-init-for-jetton-transfer'
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-tron committed Sep 27, 2024
2 parents 3f7e210 + fa4e5f1 commit b4682cd
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 b4682cd

Please sign in to comment.