Skip to content

Commit caeb05e

Browse files
committed
fix(): fix review comment
1 parent a0f554c commit caeb05e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

wallet.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,14 @@ func (w *Wallet) SendTransaction(tx *types.Transaction) (id string, err error) {
150150
return
151151
}
152152

153-
func (w *Wallet) SendPst(contractId string, target string, qty int64, customTags []types.Tag, speedFactor int64) (string, error) {
153+
func (w *Wallet) SendPst(contractId string, target string, qty *big.Int, customTags []types.Tag, speedFactor int64) (string, error) {
154+
maxQty := big.NewInt(9007199254740991) // swc support max js integer
155+
if qty.Cmp(maxQty) > 0 {
156+
return "", fmt.Errorf("qty:%s can not more than max integer:%s", qty.String(), maxQty.String())
157+
}
158+
154159
// assemble tx tags
155-
swcTags, err := utils.PstTransferTags(contractId, target, qty)
160+
swcTags, err := utils.PstTransferTags(contractId, target, qty.Int64())
156161
if err != nil {
157162
return "", err
158163
}

0 commit comments

Comments
 (0)