-
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
New mock_environment
function with valid contract address
#2215
Conversation
@@ -89,6 +103,20 @@ pub fn mock_dependencies_with_balances( | |||
} | |||
} | |||
|
|||
/// Initializes the querier along with the mock_dependencies. | |||
/// Sets all balances provided (you must explicitly set contract balance if desired). | |||
pub fn mock_dependencies_with_balances_valid( |
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.
This name is more of a placeholder because I couldn't come up with a good one.
Any ideas?
I see, not great. How do you feel about #2217 as an 80/20 solution and recommend advanced users to have their own version of |
Closing here for now, since we'll postpone to 3.0 |
an attempt at #2211
Problem is that this requires massive refactoring when changing existing tests. The borrow checker bites you whenever you use
mock_environment(&deps.api)
inside a call where you also passdeps
, so you need to create the env first and then pass it to the function.mock_dependencies_with_balances
andmock_dependencies_with_balance
are also affected by the invalid address problem and got new variants here too.