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

CosmWasm 2 address systems flaws #2157

Open
3 of 4 tasks
webmaster128 opened this issue May 29, 2024 · 0 comments
Open
3 of 4 tasks

CosmWasm 2 address systems flaws #2157

webmaster128 opened this issue May 29, 2024 · 0 comments

Comments

@webmaster128
Copy link
Member

webmaster128 commented May 29, 2024

When upgrading a complex codebase from 1.5 to 2.0 I spend roughly 1 hour to make it compile but many more hours to make all the tests pass. The biggest issue is the change in the address validation in MockApi which does not allow arbitrary strings anymore. While I still think the change is good in general and new codebases will have an easier life, there are flaws we should address.

  • mock_info takes a &str address. However, we need a Addr in the caller code and an Addr in MessageInfo. Due to the &str type it is unclear if the input is supposed to contain the full address (it does). Thies leads to a log of mock_info(manager2.as_str(), &[]) which could just be mock_info(&manager2, &[]) if the type was &Addr. (Add message_info and deprecate mock_info #2160)
  • addr_make cannot be used in DepsMut due to the way the API field is typed. Use case: shared functions like setup_channel(deps.as_mut());
  • mock_env() returns a contract address that cannot be validated #2211
  • Don't validate validator address in Multitest's .add_validator(api, storage, &block, valoper1) and probably also message delegate implementation. Validator addresses have a different layout than the account addresses. (Don't validate validator addresses cw-multi-test#173)
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