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.
HttpRequestMatcher
Matches CanisterHttpRequests whose body can be deserialized and matched by B.
HttpResponse
A mocked 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.
SingleJsonRpcMatcher
Matches the body of a single JSON-RPC request.

Traits§

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

Type Aliases§

BatchJsonRpcRequestMatcher
Matches CanisterHttpRequests whose body is a batch JSON-RPC request.
BatchJsonRpcResponse
A mocked batch JSON-RPC HTTP outcall response.
JsonRpcRequestMatcher
Matches CanisterHttpRequests whose body is a single JSON-RPC request.
JsonRpcResponse
A mocked single JSON-RPC HTTP outcall response.