refactor: MockHttpRuntime into PocketIcRuntime#43
Conversation
4527c68 to
b494162
Compare
b494162 to
6195d06
Compare
gregorydemay
left a comment
There was a problem hiding this comment.
Some understanding questions
lpahlavi
left a comment
There was a problem hiding this comment.
Thank you for having a look @gregorydemay! I've added some answers to your questions.
gregorydemay
left a comment
There was a problem hiding this comment.
Thanks @lpahlavi for this PR! Only some minor comments left
| /// | ||
| /// # See also | ||
| /// - [PocketIC live mode documentation](https://github.com/dfinity/ic/blob/f0c82237ae16745ac54dd3838b3f91ce32a6bc52/packages/pocket-ic/HOWTO.md?plain=1#L43) | ||
| pub async fn live_mode(mut self) -> Self { |
There was a problem hiding this comment.
understanding question: Do we need that method to mutate an existing instance? Wouldn't it be sufficient to have it as a constructor only? I have the impression that for tests we know from the beginning whether this runtime is going to be used with PocketIc in live mode or not and so that's why I would be more inclined to have it as a constructor. WDYT?
There was a problem hiding this comment.
Good idea! I actually like it better as you suggest, it also allows us to assert that the PocketIc instance is not in live mode when using the "regular" constructor. Done.
## 🤖 New release * `canhttp`: 0.3.0 -> 0.4.0 * `ic-canister-runtime`: 0.1.0 * `ic-agent-canister-runtime`: 0.1.0 * `ic-pocket-canister-runtime`: 0.1.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `canhttp` <blockquote> ## [0.4.0] - 2025-11-21 ### Added - Add `JsonRpcHttpLayer` which combines the `HttpConversionLayer`, `JsonConversionLayer` and `ConsistentJsonRpcIdFilter` middlewares into a single convenient-to-use layer ([#46](#46)) - Add example canisters demonstrating JSON-RPC functionalities and parallel calls ([#48](#48)) ### Changed - Bump `ic-cdk` to v0.19.0 ([#40](#40)) ### Fixed - Missing optional dependency on `serde` for `multi` feature ([#47](#47)) [0.4.0]: https://github.com/dfinity/canhttp/compare/canhttp-0.3.0..canhttp-0.4.0 </blockquote> ## `ic-canister-runtime` <blockquote> ## [0.1.0] - 2025-11-21 ### Added - Add helper methods to `CyclesWalletRuntime` ([#44](#44)) - Add READMEs and examples ([#42](#42)) - Add `StubRuntime` ([#41](#41)) - Add `CyclesWalletRuntime` ([#37](#37)) - Add `Runtime` crate and `IcRuntime` implementation ([#35](#35)) [0.1.0]: https://github.com/dfinity/canhttp/releases/tag/ic-canister-runtime-v0.1.0 </blockquote> ## `ic-agent-canister-runtime` <blockquote> ## [0.1.0] - 2025-11-21 ### Added - Add `AgentRuntime` ([#36](#36)) [0.1.0]: https://github.com/dfinity/canhttp/releases/tag/ic-agent-canister-runtime-v0.1.0 </blockquote> ## `ic-pocket-canister-runtime` <blockquote> ## [0.1.0] - 2025-11-21 ### Added - Add `ExecuteHttpOutcallMocks` trait and support for PocketIC live mode ([#43](#43)) - Add READMEs and examples ([#42](#42)) - Add `PocketIcRuntime` and mock HTTP mock infrastructure ([#38](#38)) [0.1.0]: https://github.com/dfinity/canhttp/releases/tag/ic-pocket-canister-runtime-v0.1.0 </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Louis Pahlavi <louis.pahlavi@dfinity.org>
This PR refactors the
MockHttpRuntimeinto the more genericPocketItRuntime, namely:PocketIcRuntimeto be used with or without HTTP outcall mocks.PocketIcRuntimeto be used in live mode.