From bdf80c6c3930b755c4bd1ec0dbcb6560353a2e73 Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Wed, 23 Oct 2024 12:40:35 -0300 Subject: [PATCH] chore_: add log data to paraswap requests --- .../wallet/thirdparty/paraswap/request_build_transaction.go | 6 ++++++ services/wallet/thirdparty/paraswap/request_price_route.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/services/wallet/thirdparty/paraswap/request_build_transaction.go b/services/wallet/thirdparty/paraswap/request_build_transaction.go index 1ea433cb2..1c4ca9894 100644 --- a/services/wallet/thirdparty/paraswap/request_build_transaction.go +++ b/services/wallet/thirdparty/paraswap/request_build_transaction.go @@ -8,6 +8,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" walletCommon "github.com/status-im/status-go/services/wallet/common" ) @@ -56,10 +57,15 @@ func (c *ClientV5) BuildTransaction(ctx context.Context, srcTokenAddress common. } url := fmt.Sprintf(transactionsURL, c.chainID) + + log.Info("BuildTransaction", "url", url) + log.Info("BuildTransaction", "params", params) + log.Info("BuildTransaction", "priceRoute", string(priceRoute)) response, err := c.httpClient.DoPostRequest(ctx, url, params, nil) if err != nil { return Transaction{}, err } + log.Info("BuildTransaction", "response", string(response)) tx, err := handleBuildTransactionResponse(response) if err != nil { diff --git a/services/wallet/thirdparty/paraswap/request_price_route.go b/services/wallet/thirdparty/paraswap/request_price_route.go index 8464eb060..ecccc93a4 100644 --- a/services/wallet/thirdparty/paraswap/request_price_route.go +++ b/services/wallet/thirdparty/paraswap/request_price_route.go @@ -9,6 +9,7 @@ import ( "strconv" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" "github.com/status-im/status-go/services/wallet/bigint" ) @@ -53,10 +54,13 @@ func (c *ClientV5) FetchPriceRoute(ctx context.Context, srcTokenAddress common.A params.Add("version", "6.2") url := pricesURL + log.Info("FetchPriceRoute", "url", url) + log.Info("FetchPriceRoute", "params", params) response, err := c.httpClient.DoGetRequest(ctx, url, params, nil) if err != nil { return Route{}, err } + log.Info("FetchPriceRoute", "response", string(response)) return handlePriceRouteResponse(response) }