Skip to content

feat(token): integrate indexer provider#195

Open
dhyaniarun1993 wants to merge 9 commits intomainfrom
arun/feat/integrate-indexer-provider
Open

feat(token): integrate indexer provider#195
dhyaniarun1993 wants to merge 9 commits intomainfrom
arun/feat/integrate-indexer-provider

Conversation

@dhyaniarun1993
Copy link
Copy Markdown
Member

Closes #192

@dhyaniarun1993 dhyaniarun1993 self-assigned this Apr 8, 2026
@dhyaniarun1993 dhyaniarun1993 changed the title Arun/feat/integrate indexer provider feat(token): integrate indexer provider Apr 8, 2026
@dhyaniarun1993 dhyaniarun1993 marked this pull request as draft April 8, 2026 16:28
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread pkg/indexer/client/http.go
@dhyaniarun1993 dhyaniarun1993 marked this pull request as ready for review April 10, 2026 08:18
// 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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's fine since indexer is our internal service. Let me know what you think.

Comment thread config.e2e-local.yaml
Comment on lines +68 to +69
PROMPT: "BridgeIssuer::1220192c25966fe2d53554dfe3a7e2c1c786268318f9870a26902935f3c912ac51ac"
DEMO: "BridgeIssuer::1220192c25966fe2d53554dfe3a7e2c1c786268318f9870a26902935f3c912ac51ac"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just commenting that these will probably change as we test

Copy link
Copy Markdown
Contributor

@salindne salindne left a comment

Choose a reason for hiding this comment

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

Small fix, otherwise looks great

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 17.07317% with 34 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@523cfdb). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/app/api/server.go 0.00% 30 Missing ⚠️
pkg/config/config.go 66.66% 1 Missing and 1 partial ⚠️
pkg/indexer/client/http.go 60.00% 1 Missing and 1 partial ⚠️

❌ 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

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #195   +/-   ##
=======================================
  Coverage        ?   32.37%           
=======================================
  Files           ?      123           
  Lines           ?     8537           
  Branches        ?        0           
=======================================
  Hits            ?     2764           
  Misses          ?     5533           
  Partials        ?      240           
Flag Coverage Δ
unittests 32.37% <17.07%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/config/config.go 71.18% <66.66%> (ø)
pkg/indexer/client/http.go 86.66% <60.00%> (ø)
pkg/app/api/server.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

feat(config): make token data provider selectable or support multiple provider

4 participants