Skip to main content

Crate ic_pocket_canister_runtime

Crate ic_pocket_canister_runtime 

Source
Expand description

Library to mock HTTP outcalls on the Internet Computer leveraging the ic_canister_runtime crate’s Runtime trait as well as PocketIc.

Structs§

AnyCanisterHttpRequestMatcher
Implementation of CanisterHttpRequestMatcher that matches all requests.
CanisterHttpReject
A wrapper over CanisterHttpReject that offers a fluent API to create instances.
CanisterHttpReply
A wrapper over CanisterHttpReply that offers a fluent API to create instances.
JsonRpcRequestMatcher
Matches CanisterHttpRequests whose body is a JSON-RPC request.
JsonRpcResponse
A mocked JSON-RPC HTTP outcall response.
MockHttpOutcall
A mocked HTTP outcall with a mocked canister response and a CanisterHttpRequestMatcher to find matching requests.
MockHttpOutcallBuilder
The result of calling MockHttpOutcallsBuilder::given, used to add a new mock to a MockHttpOutcallsBuilder. See the respond_with method.
MockHttpOutcalls
A collection of HTTP outcall mocks.
MockHttpOutcallsBuilder
A MockHttpOutcallsBuilder to create a MockHttpOutcalls with a fluent API.
PocketIcRuntime
Runtime using PocketIc to make calls to canisters.

Traits§

CanisterHttpRequestMatcher
A trait that allows checking if a given CanisterHttpRequest matches an HTTP outcall mock.
ExecuteHttpOutcallMocks
Execute HTTP outcall mocks.