-
Notifications
You must be signed in to change notification settings - Fork 341
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
mock_env()
contains invalid Address
#2276
Comments
And is there a simpler way to get address prefix than from |
This will be fixed for The other part will be fixed in 3.0 by requiring an |
The simplest way is to know what chain you deploy on and just use their prefix. Why do you need it at runtime? |
To generate address from public key. Don't want to have different wasm for each chain I deploy |
Ah, I see. To avoid a different wasm per chain, you could also make it a parameter in the If you really really want it programmatically, you'd have to go through a Stargate / Grpc query. It has to be allowlisted by the chain, but most chains have pretty big allow lists. See neutron for example: https://docs.rs/neutron-std/latest/neutron_std/types/cosmos/auth/v1beta1/struct.AuthQuerier.html#method.bech32_prefix |
MockApi after 2.0 expects valid bech32 address, so current implementation of
mock_env()
would fail address validation:I would prefer to have valid address instead, for example
Or more flexible with passing MockApi inside mock env function:
The text was updated successfully, but these errors were encountered: