fix_: router crash when packid is nil

This commit is contained in:
Sale Djenic 2024-06-13 15:38:08 +02:00 committed by saledjenic
parent 462013520f
commit 07882d9259
1 changed files with 4 additions and 5 deletions

View File

@ -13,7 +13,6 @@ import (
"github.com/status-im/status-go/params" "github.com/status-im/status-go/params"
"github.com/status-im/status-go/services/ens" "github.com/status-im/status-go/services/ens"
"github.com/status-im/status-go/services/wallet/async" "github.com/status-im/status-go/services/wallet/async"
"github.com/status-im/status-go/services/wallet/bigint"
walletCommon "github.com/status-im/status-go/services/wallet/common" walletCommon "github.com/status-im/status-go/services/wallet/common"
"github.com/status-im/status-go/services/wallet/router/pathprocessor" "github.com/status-im/status-go/services/wallet/router/pathprocessor"
walletToken "github.com/status-im/status-go/services/wallet/token" walletToken "github.com/status-im/status-go/services/wallet/token"
@ -49,9 +48,9 @@ type RouteInputParams struct {
TestnetMode bool `json:"testnetMode"` TestnetMode bool `json:"testnetMode"`
// For send types like EnsRegister, EnsRelease, EnsSetPubKey, StickersBuy // For send types like EnsRegister, EnsRelease, EnsSetPubKey, StickersBuy
Username string `json:"username"` Username string `json:"username"`
PublicKey string `json:"publicKey"` PublicKey string `json:"publicKey"`
PackID *bigint.BigInt `json:"packID"` PackID *hexutil.Big `json:"packID"`
} }
type PathV2 struct { type PathV2 struct {
@ -492,7 +491,7 @@ func (r *Router) SuggestedRoutesV2(ctx context.Context, input *RouteInputParams)
Username: input.Username, Username: input.Username,
PublicKey: input.PublicKey, PublicKey: input.PublicKey,
PackID: input.PackID.Int, PackID: input.PackID.ToInt(),
} }
can, err := pProcessor.AvailableFor(processorInputParams) can, err := pProcessor.AvailableFor(processorInputParams)