Closed daewoochen closed 1 month ago
either . ^
tries to pack your data to the same cell if it is enough free bits, if not - it will be saved as a reference, so it is normal behaviour, short comment can be stored in the same cell with previous data, this way transaction will be cheaper.
If for some reason you want to store payload as reference you can do it by wrapping your cell to comment = cell.BeginCell().MustStoreRef(comment).EndCell()
This issue has been resolved, thanks!
comment, _ := wallet.CreateCommentCell("hello world!")
transferPayload, _ := tokenWallet.BuildTransferPayloadV2(to, w.Address(), amountTokens, tlb.MustFromTON("0.1"), comment, nil)
tlb:"either . ^"
totlb:"either ^ ."
ortlb:"maybe ^"
, the refs field of transferPayload obtained through tokenWallet.BuildTransferPayloadV2 is not 0. When I get tx.IO.In.AsInternal().Body.RefsNum() through api.SubscribeOnTransactions, it is not 0, so I can get the comment. So why does this happen? What is the correct way to use it? Thank you.