Skip to content

[WIP] Fix logging tag for GetCurrentMarketsTrxPrice function - #54

Merged
Lawrence Lucas Large (LukeLarge) merged 1 commit into
masterfrom
copilot/fix-logging-tag-getcurrentmarketstrxprice
Mar 21, 2026
Merged

[WIP] Fix logging tag for GetCurrentMarketsTrxPrice function#54
Lawrence Lucas Large (LukeLarge) merged 1 commit into
masterfrom
copilot/fix-logging-tag-getcurrentmarketstrxprice

Conversation

Copilot AI commented Mar 21, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"The function 'GetCurrentMarketsTrxPrice' is logging errors with the tag '[GetCurrentMarketsTonPrice]' instead of '[GetCurrentMarketsTrxPrice]'. This makes debugging more difficult as the logs will be misleading about which function encountered the error.","fixFiles":[{"filePath":"pkg/rates/market.go","diff":"diff --git a/pkg/rates/market.go b/pkg/rates/market.go\n--- a/pkg/rates/market.go\n+++ b/pkg/rates/market.go\n@@ -224,13 +224,13 @@\n \t\theaders := http.Header{\"Content-Type\": {\"application/json\"}}\n \t\trespBody, err := sendRequest(market.URL, \"\", headers)\n \t\tif err != nil {\n-\t\t\tslog.Error(\"[GetCurrentMarketsTonPrice] failed to send request\", slog.Any(\"error\", err))\n+\t\t\tslog.Error(\"[GetCurrentMarketsTrxPrice] failed to send request\", slog.Any(\"error\", err))\n \t\t\terrorsCounter.WithLabelValues(market.Name).Inc()\n \t\t\tcontinue\n \t\t}\n \t\tmarket.UsdPrice, err = market.MarketPriceConverter(respBody)\n \t\tif err != nil {\n-\t\t\tslog.Error(\"[GetCurrentMarketsTonPrice] failed to convert response\", slog.Any(\"error\", err))\n+\t\t\tslog.Error(\"[GetCurrentMarketsTrxPrice] failed to convert response\", slog.Any(\"error\", err))\n \t\t\terrorsCounter.WithLabelValues(market.Name).Inc()\n \t\t\tcontinue\n \t\t}\n"}]},{"message":"The function 'GetCurrentMarketsTrxPrice' is logging errors with the tag '[GetCurrentMarketsTonPrice]' instead of '[GetCurrentMarketsTrxPrice]'. This makes debugging more difficult as the logs will be misleading about which function encountered the error.","fixFiles":[{"filePath":"pkg/rates/market.go","diff":"diff --git a/pkg/rates/market.go b/pkg/rates/market.go\n--- a/pkg/rates/market.go\n+++ b/pkg/rates/market.go\n@@ -224,13 +224,13 @@\n \t\theaders := http.Header{\"Content-Type\": {\"application/json\"}}\n \t\trespBody, err := sendRequest(market.URL, \"\", headers)\n \t\tif err != nil {\n-\t\t\tslog.Error(\"[GetCurrentMarketsTonPrice] failed to send request\", slog.Any(\"error\", err))\n+\t\t\tslog.Error(\"[GetCurrentMarketsTrxPrice] failed to send request\", slog.Any(\"error\", err))\n \t\t\terrorsCounter.WithLabelValues(market.Name).Inc()\n \t\t\tcontinue\n \t\t}\n \t\tmarket.UsdPrice, err = market.MarketPriceConverter(respBody)\n \t\tif err != nil {\n-\t\t\tslog.Error(\"[GetCurrentMarketsTonPrice] failed to convert response\", slog.Any(\"error\", err))\n+\t\t\tslog.Error(\"[GetCurrentMarketsTrxPrice] failed to convert response\", slog.Any(\"error\", err))\n \t\t\terrorsCounter.WithLabelValues(market.Name).Inc()\n \t\t\tcontinue\n \t\t}\n"}]},{"message":"The condition checks 'record[3] != \\\"true\\\"' but the comment on line 738 states 'second_asset_native contains true'. This appears to be inverted logic. The condition should likely be 'record[3] == \\\"true\\\"' to match the comment and the pattern used in the first case.","fixFiles":[{"filePath":"pkg/rates/market.go","diff":"diff --git a/pkg/rates/market.go b/pkg/rates/market.go\n--- a/pkg/rates/market.go\n+++ b/pkg/rates/market.go\n@@ -736,7 +736,7 @@\n \t\t\tsecondAsset = Asset{Account: secondAccountID}\n \t\t\t// If the column second_asset has no address and the column second_asset_native contains true,\n \t\t\t// then we consider this token as a pool to TON\n-\t\tcase record[1] == \"NULL\" && record[3] != \"true\":\n+\t\tcase record[1] == \"NULL\" && record[3] == \"true\":\n \t\t\tfirstAccountID, err := ton.ParseAccountID(record[0])\n \t\t\tif err != nil {\n \t\t\t\treturn Pool{}, err\n"}]},{"message":"The error check on line 963 is unreachable because 'decimals' is assigned a constant value and no error-producing operation precedes this check. This appears to be dead code that should be removed.","fixFiles":[{"filePath":"pkg/rates/market.go","diff":"diff --git a/pkg/rates/market.go b/pkg/rates/market.go\n--- a/pkg/rates/market.go\n+++ b/pkg/rates/market.go\n@@ -960,9 +960,6 @@\n \t\t\treturn LpAsset{}, fmt.Errorf(\"failed to parse total supply\")\n \t\t}\n \t\tdecimals := defaultDecimals\n-\t\tif err != nil {\n-\t\t\treturn LpAsset{}, err\n-\t\t}\n \t\treturn LpAsset{\n \t\t\tAccount:     lpAsset,\n \t\t\tDecimals:    decimals,\n"}]}]

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LukeLarge
Lawrence Lucas Large (LukeLarge) merged commit 63442b0 into master Mar 21, 2026
6 checks passed
Copilot stopped work on behalf of Lawrence Lucas Large (LukeLarge) due to an error March 21, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants