Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query balance response #464

Merged
merged 1 commit into from
Mar 22, 2021
Merged

Fix query balance response #464

merged 1 commit into from
Mar 22, 2021

Conversation

akhilkumarpilli
Copy link
Contributor

@akhilkumarpilli akhilkumarpilli commented Mar 20, 2021

No description provided.

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

LGTM, but I think the code could be adjusted some more. Going to merge the pr but leave the issue open

continue
}

for i, d := range dts.DenomTraces {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just do a query using this route instead of looping over all the traces


for i, d := range dts.DenomTraces {
if c.Denom == d.IBCDenom() {
out = append(out, sdk.Coin{Denom: d.GetFullDenomPath(), Amount: c.Amount})
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd rather make our own coin type, something like

type Coin struct {
    Denom string
    Amount uint64
}

It is a little unnecessary, but I don't really trust things not to go wrong, since using the full denom path is an invalid sdk.Coin

@colin-axner colin-axner merged commit 1ff4ae1 into master Mar 22, 2021
@colin-axner colin-axner deleted the akhil/fix-query-balance branch March 22, 2021 13:28
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.

2 participants