Querying native coins balance for tests with cw-multi-test
Continuing from our previous post on creating native coins for tests, it’s also helpful to get a user’s balance to check if it has changed as we expect it in a test.
I was a bit confused since the docstring for app.raw_query made references to generated helpers for queries, but intellisense showed no relevant methods on the App type.
It’s likely I missed a trait, but instead I opted to use the raw_query and parse the resulting message myself. Queries return Binary data, which must be parsed. In the case of a balance query, the relevant type is BalanceResponse.