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

Wasm querier integration tests #273

Merged
merged 6 commits into from
Oct 6, 2020
Merged

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Oct 6, 2020

Closes #269

  • Test WasmQuery::Smart and WasmQuery::Raw via
  • Test basic staking queries with reflect contract

Not done:

  • Update docs explaining how to parse RawQuery (maybe update types in CosmWasm? maybe change from this []{Key, Value} return value...) - this is moved to Update RawQuery return value #275

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #273 into master will increase coverage by 0.85%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #273      +/-   ##
==========================================
+ Coverage   73.32%   74.17%   +0.85%     
==========================================
  Files          27       27              
  Lines        2339     2339              
==========================================
+ Hits         1715     1735      +20     
+ Misses        511      485      -26     
- Partials      113      119       +6     
Impacted Files Coverage Δ
x/wasm/internal/keeper/keeper.go 90.30% <0.00%> (-0.61%) ⬇️
x/wasm/internal/keeper/query_plugins.go 77.69% <0.00%> (+15.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b479c3...273a192. Read the comment docs.

@ethanfrey ethanfrey requested a review from alpe October 6, 2020 07:48
Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

🌷 Very nice.

x/wasm/internal/keeper/reflect_test.go Outdated Show resolved Hide resolved
x/wasm/internal/keeper/reflect_test.go Show resolved Hide resolved
x/wasm/internal/keeper/reflect_test.go Outdated Show resolved Hide resolved
x/wasm/internal/keeper/staking_test.go Outdated Show resolved Hide resolved
x/wasm/internal/keeper/staking_test.go Outdated Show resolved Hide resolved
// BondedDenom -> Atom
// Delegation -> With detailed info
}

Copy link
Contributor

Choose a reason for hiding this comment

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

pp: there was quite some effort to setup the test. I was wondering if a staking keeper mock would be an easier fit or what was your intention?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need to see how the query callbacks from the contracts really work.

I have a contract that will take the user input and use that to trigger a query via Querier. This allows us to see what a contract would see. And we need to see what would happen against a real staking keeper (as there are some bugs... we want to fix how those work, full stack for compatibility).

@alpe alpe self-requested a review October 6, 2020 10:17
@ethanfrey ethanfrey marked this pull request as ready for review October 6, 2020 11:51
@ethanfrey ethanfrey merged commit b0add1f into master Oct 6, 2020
@ethanfrey ethanfrey deleted the wasm-querier-integration-tests branch October 6, 2020 11:57
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.

Add high-level integration tests for contract querier usage
2 participants