AbstractSDK / cw-orchestrator

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

Fix raw_query for mock #400

Closed Buckram123 closed 3 months ago

Buckram123 commented 3 months ago

This PR aims at fixing raw_query method for mock env

cloudflare-pages[bot] commented 3 months ago

Deploying cw-orchestrator with  Cloudflare Pages  Cloudflare Pages

Latest commit: 049cbb3
Status: ✅  Deploy successful!
Preview URL: https://79be4044.cw-orchestrator.pages.dev
Branch Preview URL: https://fix-mock-raw-query.cw-orchestrator.pages.dev

View logs

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 80.95238% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 64.6%. Comparing base (33de752) to head (049cbb3).

Additional details and impacted files | [Files](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/400?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK) | Coverage Δ | | |---|---|---| | [contracts/mock\_contract/src/lib.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/400?src=pr&el=tree&filepath=contracts%2Fmock_contract%2Fsrc%2Flib.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-Y29udHJhY3RzL21vY2tfY29udHJhY3Qvc3JjL2xpYi5ycw==) | `97.4% <95.8%> (-0.5%)` | :arrow_down: | | [packages/cw-orch-mock/src/queriers/wasm.rs](https://app.codecov.io/gh/AbstractSDK/cw-orchestrator/pull/400?src=pr&el=tree&filepath=packages%2Fcw-orch-mock%2Fsrc%2Fqueriers%2Fwasm.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AbstractSDK#diff-cGFja2FnZXMvY3ctb3JjaC1tb2NrL3NyYy9xdWVyaWVycy93YXNtLnJz) | `88.7% <61.1%> (+9.0%)` | :arrow_up: |
Kayanski commented 3 months ago

This PR aims at fixing raw_query method for mock env

Could you elaborate what this is for ?

Buckram123 commented 3 months ago

This PR aims at fixing raw_query method for mock env

Could you elaborate what this is for ?

Just a bugfix. Wanted to cw2 raw query in mock env, to see what contract is that addr, got error instead: Error: Error parsing into type alloc::vec::Vec<u8>: Invalid type.

Kayanski commented 3 months ago

This PR aims at fixing raw_query method for mock env

Could you elaborate what this is for ?

Just a bugfix. Wanted to cw2 raw query in mock env, to see what contract is that addr, got error instead: Error: Error parsing into type alloc::vec::Vec<u8>: Invalid type.

Oh, so the to_json_binary function was not working properly ?

Buckram123 commented 3 months ago

This PR aims at fixing raw_query method for mock env

Could you elaborate what this is for ?

Just a bugfix. Wanted to cw2 raw query in mock env, to see what contract is that addr, got error instead: Error: Error parsing into type alloc::vec::Vec<u8>: Invalid type.

Oh, so the to_json_binary function was not working properly ?

No, it(raw_query method for mock env) was trying to deserialize raw query response into Vec<u8>, but it can succeed only if response was b"[1, 2, 3]", not if it's b"{"foo": "bar"}