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

x/tokenfactory/keeper: unexpected inconsistency mixing non-gRPC errors without a status+ code in an area with gRPC errors #316

Open
odeke-em opened this issue Mar 9, 2024 · 0 comments

Comments

@odeke-em
Copy link

odeke-em commented Mar 9, 2024

This code is quite inconsistent when an error is encountered while parsing an address https://github.com/noble-assets/noble/blob/main/x/tokenfactory/keeper/grpc_query_blacklisted.go#L49-L52

image

and also inside Keeper.Mint

_, addressBz, err = bech32.DecodeAndConvert(msg.Address)
if err != nil {
return nil, err
in an area where errors are being wrapped and sent over with a status code

Remedy

Use status codes to wrap that error with a code of InvalidArgument and please add a test for invalid addresses because the presence of that error not being caught means that the other RPC is going to encounter an unexpected error or could even crash

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

No branches or pull requests

1 participant