You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bank query balances command panics when used with --resolve-denom flag if any token's metadata lacks a display field. The panic occurs in sdk.NewCoin() during coin validation because an empty denom string is passed when metadata.Display is empty.
For example, querying metadata for factory/neutron10r39fueph9fq7a6lgswu4zdsg8t3gxlqgn9xk5/Governance on Neutron shows:
The code at x/bank/keeper/grpc_query.go:68 uses metadata.Display without checking if it exists, passing an empty string to sdk.NewCoin(). This triggers a panic in the NewCoin function during coin.Validate() as empty denom strings are invalid.
Expected behavior:
When display field is missing from metadata, the query should fall back to using the base denom instead of attempting to create a coin with an empty denom.
Cosmos SDK Version
main
How to reproduce?
How to reproduce:
Find an account holding tokens whose metadata lacks a display field
Run bank balances query with --resolve-denom flag:
neutrond query bank balances neutron1qpqw3h7a2k9s0jkjtjfa8ghhes4jdevs89uljn --resolve-denom
Is there an existing issue for this?
What happened?
The
bank query balances
command panics when used with--resolve-denom
flag if any token's metadata lacks adisplay
field. The panic occurs insdk.NewCoin()
during coin validation because an empty denom string is passed whenmetadata.Display
is empty.For example, querying metadata for
factory/neutron10r39fueph9fq7a6lgswu4zdsg8t3gxlqgn9xk5/Governance
on Neutron shows:The code at
x/bank/keeper/grpc_query.go:68
usesmetadata.Display
without checking if it exists, passing an empty string tosdk.NewCoin()
. This triggers a panic in theNewCoin
function duringcoin.Validate()
as empty denom strings are invalid.Expected behavior:
When
display
field is missing from metadata, the query should fall back to using the base denom instead of attempting to create a coin with an empty denom.Cosmos SDK Version
main
How to reproduce?
How to reproduce:
display
field--resolve-denom
flag:Current output:
Expected output: The query should complete successfully, showing balances with base denoms for tokens lacking display fields.
The text was updated successfully, but these errors were encountered: