Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an alternative "indexer" mode for the token data provider, allowing the system to query balances and total supply via a pre-materialized HTTP API instead of live gRPC scans. Key changes include the implementation of an HTTP client for the indexer, a new indexer-backed provider, and configuration updates to support mode selection. Feedback was provided to improve the robustness of error handling in the indexer client by ensuring that raw response bodies are captured as a fallback when JSON error decoding fails for non-2xx status codes.
| // If the body is not JSON (e.g. an HTML gateway error page), errMsg | ||
| // stays empty and the status code alone is returned to the caller. | ||
| var errMsg string | ||
| bodyBytes, err := io.ReadAll(resp.Body) |
There was a problem hiding this comment.
this is an HTTP client calling an external service, we dont conrol what comes back on error paths.
maybe something like :
bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, 4096))
There was a problem hiding this comment.
I think it's fine since indexer is our internal service. Let me know what you think.
| PROMPT: "BridgeIssuer::1220192c25966fe2d53554dfe3a7e2c1c786268318f9870a26902935f3c912ac51ac" | ||
| DEMO: "BridgeIssuer::1220192c25966fe2d53554dfe3a7e2c1c786268318f9870a26902935f3c912ac51ac" |
There was a problem hiding this comment.
just commenting that these will probably change as we test
salindne
left a comment
There was a problem hiding this comment.
Small fix, otherwise looks great
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (17.07%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
=======================================
Coverage ? 32.37%
=======================================
Files ? 123
Lines ? 8537
Branches ? 0
=======================================
Hits ? 2764
Misses ? 5533
Partials ? 240
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Closes #192