-
Notifications
You must be signed in to change notification settings - Fork 338
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
Add make_addr
function to MockApi
#1905
Conversation
Default settings for Bech32 encoded addresses are:
To have an option to change the default settings during let mock_api = MockApi::with_bech32("juno", false, false); where the definition could be like: pub fn with_bech32(prefix: &'static str, bech32m: bool, short: bool) -> MockApi where the arguments would be:
To make function let mock_api = MockApi::default();
let addr = mock_api.addr_make("creator");
assert_eq!(Addr::unchecked("creator"), addr); but initializing let mock_api = MockApi::with_bech32("juno", false, false);
let addr = mock_api.addr_make("creator");
assert_eq!("juno1h34lmpywh4upnjdg90cjf4j70aee6z8qqfspugamjp42e4q28kqsksmtyp", addr.to_string()); This way we could preserve the old behaviour in existing tests, so users could gradually migrate from using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Few points inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff. Just a few smaller things.
I'd appreciate if @chipshort could do another review and wrap this up for 1.5. We should have a CHANGELOG entry here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one small comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
closes #1887