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

Let mock_env return a contract address that is compatible with MockApi #2217

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

webmaster128
Copy link
Member

While this only solves part of the problem, it allows a huge portion of users to keep their tests unchanged.

@chipshort
Copy link
Collaborator

Yes, this is a simpler middleground solution that I also thought about, but (as you can see) also causes some test failures when the tests assume that the address is equal to MOCK_CONTRACT_ADDRESS.
We should probably also adjust at least mock_dependencies_with_balance in a similar way.
Maybe even mock_dependencies_with_balances, but that would probably cause other tests to fail.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@webmaster128 webmaster128 force-pushed the match-MockApi-mock_env branch from b4faaf5 to 54d1d3d Compare August 20, 2024 09:13
@webmaster128
Copy link
Member Author

Okay, seems to be better now.

  • MOCK_CONTRACT_ADDR is the actual bech32 address
  • Added some comments for BankQuerier address management. No change required here as far as I can tell as the strings in the map are supposed to be the addresses already.
  • Applied the same changes to cosmwasm-vm

Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This should cover most cases while not failing tests unnecessarily.

Co-authored-by: Christoph Otter <[email protected]>
@webmaster128 webmaster128 merged commit d20aca7 into main Aug 20, 2024
32 checks passed
@webmaster128 webmaster128 deleted the match-MockApi-mock_env branch August 20, 2024 14:48
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

Successfully merging this pull request may close these issues.

None yet

2 participants