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

feat: improve mock desmos app #38

Merged
merged 18 commits into from
Sep 16, 2022
Merged

feat: improve mock desmos app #38

merged 18 commits into from
Sep 16, 2022

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Aug 8, 2022

This PR intends to give a way to build custom DesmosKeeper for tests by having a new trait DesmosModule.

pub struct CustomDesmosKeeper {}
impl DesmosModule for CustomDesmosKeeper {
   // custom handle functions
}

#[test]
fn test_something() -> {
    let mut app = custom_desmos_app(CustomDesmosKeeper{}, |_, _, _| {});
    // test with custom mock app ...
}

After CosmWasm/cw-plus#773 is released, it can be merged.

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Base: 90.94% // Head: 91.10% // Increases project coverage by +0.15% 🎉

Coverage data is based on head (78bcf0a) compared to base (168ddc3).
Patch coverage: 97.14% of modified lines in pull request are covered.

❗ Current head 78bcf0a differs from pull request most recent head 347614f. Consider uploading reports for the commit 347614f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   90.94%   91.10%   +0.15%     
==========================================
  Files          27       27              
  Lines        2276     2350      +74     
==========================================
+ Hits         2070     2141      +71     
- Misses        206      209       +3     
Impacted Files Coverage Δ
packages/bindings-test/src/chain_communication.rs 0.00% <0.00%> (ø)
packages/bindings/src/reactions/querier.rs 65.71% <ø> (ø)
packages/bindings/src/relationships/querier.rs 89.36% <ø> (ø)
packages/bindings/src/subspaces/mocks.rs 100.00% <ø> (ø)
packages/bindings/src/subspaces/querier.rs 91.70% <ø> (ø)
packages/bindings/src/profiles/querier.rs 92.12% <90.90%> (-0.22%) ⬇️
packages/bindings/src/posts/mocks.rs 99.00% <98.79%> (ø)
packages/bindings/src/mocks/mock_queriers.rs 98.14% <100.00%> (ø)
packages/bindings/src/posts/querier.rs 90.86% <100.00%> (+0.09%) ⬆️
packages/bindings/src/profiles/mocks.rs 100.00% <100.00%> (ø)
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dadamu dadamu marked this pull request as ready for review September 15, 2022 11:29
@@ -0,0 +1,776 @@
#![cfg(not(tarpaulin_include))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file shows the default desmos keeper migrated from mock_app.rs

@manu0466 manu0466 added the automerge Automatically merge PR once all prerequisites pass label Sep 16, 2022
@mergify mergify bot merged commit bb9fe1b into main Sep 16, 2022
@mergify mergify bot deleted the paul/improve-mock-desmos-app branch September 16, 2022 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants