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

Improve ContractInfo mock querier #375

Open
maurolacy opened this issue Dec 1, 2021 · 3 comments
Open

Improve ContractInfo mock querier #375

maurolacy opened this issue Dec 1, 2021 · 3 comments

Comments

@maurolacy
Copy link
Contributor

maurolacy commented Dec 1, 2021

Related to #368.

We're currently mocking a querier for tgrade-trusted-circle unit tests. As part of it, we're implementing a ContractInfo querier, which returns dummy data. Improve on this by returning "real" (i.e. previosuly stored, or logically defined) data for the contract.

Also, consider moving / generalizing this mock querier somewhere / somehow (related to CosmWasm/cosmwasm#1050, and see #368 (comment)).

@maurolacy maurolacy changed the title Improve contract_info mock Improve ContractInfo mock querier Dec 1, 2021
@ethanfrey ethanfrey added this to the V0.5.1 milestone Dec 2, 2021
@ethanfrey ethanfrey modified the milestones: V0.5.1, v0.5.2 Dec 27, 2021
@hashedone
Copy link
Contributor

hashedone commented Jan 5, 2022

Improve on this by returning "real" (i.e. previosuly stored, or logically defined)

I find it being kind of a conradiction of the typical mocks usages. Typically mocks are configured to return fixed data (possibly configured in test directly). What you are proposing is basically simulating environment and we have it - it is called multitest. Maybe we should consider switching to multitest for those cases?

@maurolacy
Copy link
Contributor Author

I think it would be good to have this for unit tests as well.

There's currently CosmWasm/cosmwasm#1050 that introduces a method for doing that, but it's still cumbersome / verbose to use. Let's follow the discussion there, to see if that can be improved.

@hashedone hashedone self-assigned this Jan 7, 2022
@hashedone
Copy link
Contributor

I kind of understand you even if I don't fully like idea testing such things in UT instead of MT. However I feel like it is kind of blocked by CosmWasm/cosmwasm#1050 and I am wondering - is it needed for v0.5.3? I would wait with it till the shape of this is well defined in 1050, as tests are actually existing for now.

@hashedone hashedone removed their assignment Jan 10, 2022
@ethanfrey ethanfrey removed this from the v0.5.3 milestone Jan 11, 2022
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

3 participants