AbstractSDK / cw-orchestrator

All-in-one Rust-based CosmWasm testing, scripting, and deployment tool.
https://orchestrator.abstract.money
GNU General Public License v3.0
79 stars 18 forks source link

Separate Querier and TxHandler #298

Closed Kayanski closed 9 months ago

Kayanski commented 10 months ago

This PR aims at separating the querying and the transaction signing capabilities of CwEnv.

Closes ORC-61

Changes

  1. Removed BankQuerier : Replaced by BankQuerierGetter and BankQuerier on top of it
  2. Removed WasmCodeQuerier: Replaced by WasmQuerierGetter and WasmQuerier. Local hash function is also added in this trait
cloudflare-workers-and-pages[bot] commented 10 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ee2ab1d
Status: ✅  Deploy successful!
Preview URL: https://83874985.cw-orchestrator.pages.dev
Branch Preview URL: https://update-separate-query-tx.cw-orchestrator.pages.dev

View logs

CyberHoward commented 10 months ago

Deprecation issues

The block_info function of TxHandler is now marked as deprecated but we can't implement the exact same function on the QueryHandler trait because it would conflict with this function as long as it exists.

I think that we need to publish a breaking version for this change because of that !

Traits can have the same function. When calling the function the user needs to have either of the traits imported. If they are both imported they need to specify which trait they want to use. i.e.

TxHandler::block_info(chain)

So no breaking change required here afaik

Kayanski commented 10 months ago

Deprecation issues

The block_info function of TxHandler is now marked as deprecated but we can't implement the exact same function on the QueryHandler trait because it would conflict with this function as long as it exists. I think that we need to publish a breaking version for this change because of that !

Traits can have the same function. When calling the function the user needs to have either of the traits imported. If they are both imported they need to specify which trait they want to use. i.e.

TxHandler::block_info(chain)

So no breaking change required here afaik

The error that show up at the following line shows exactly what I meant with this comment : https://github.com/AbstractSDK/cw-orchestrator/blob/update/separate-query-tx/contracts/counter/src/interface.rs#L48

CyberHoward commented 10 months ago

Can we maybe start working with milestones in github for breaking versions? I created one for 0.20

Have you merged anything that was breaking?

Kayanski commented 10 months ago

Can we maybe start working with milestones in github for breaking versions? I created one for 0.20 --> OK

Have you merged anything that was breaking? --> No

codecov[bot] commented 9 months ago

Codecov Report

Attention: 491 lines in your changes are missing coverage. Please review.

Comparison is base (f39ab04) 66.4% compared to head (ee2ab1d) 65.4%. Report is 2 commits behind head on main.

Additional details and impacted files | [Files](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK) | Coverage Δ | | |---|---|---| | [cw-orch-daemon/src/error.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-Y3ctb3JjaC1kYWVtb24vc3JjL2Vycm9yLnJz) | `14.2% <ø> (ø)` | | | [...ges/cw-orch-core/src/contract/contract\_instance.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9jb250cmFjdC9jb250cmFjdF9pbnN0YW5jZS5ycw==) | `81.8% <100.0%> (+3.4%)` | :arrow_up: | | [...ages/cw-orch-core/src/contract/interface\_traits.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9jb250cmFjdC9pbnRlcmZhY2VfdHJhaXRzLnJz) | `75.9% <100.0%> (+5.3%)` | :arrow_up: | | [...kages/cw-orch-core/src/environment/queriers/mod.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9lbnZpcm9ubWVudC9xdWVyaWVycy9tb2QucnM=) | `100.0% <100.0%> (ø)` | | | [...ages/cw-orch-core/src/environment/queriers/wasm.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9lbnZpcm9ubWVudC9xdWVyaWVycy93YXNtLnJz) | `100.0% <100.0%> (ø)` | | | [packages/cw-orch-core/src/environment/state.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9lbnZpcm9ubWVudC9zdGF0ZS5ycw==) | `55.5% <ø> (ø)` | | | [packages/cw-orch-mock/src/core.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1tb2NrL3NyYy9jb3JlLnJz) | `93.7% <100.0%> (+6.2%)` | :arrow_up: | | [...kages/cw-orch-core/src/environment/queriers/env.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9lbnZpcm9ubWVudC9xdWVyaWVycy9lbnYucnM=) | `0.0% <0.0%> (ø)` | | | [cw-orch-daemon/src/tx\_broadcaster.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-Y3ctb3JjaC1kYWVtb24vc3JjL3R4X2Jyb2FkY2FzdGVyLnJz) | `76.7% <0.0%> (ø)` | | | [packages/cw-orch-core/src/environment/mut\_env.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1jb3JlL3NyYy9lbnZpcm9ubWVudC9tdXRfZW52LnJz) | `0.0% <0.0%> (ø)` | | | ... and [27 more](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/298?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK) | |
Kayanski commented 9 months ago

In standby until https://github.com/AbstractSDK/cw-orchestrator/pull/318 is done