pub trait CallHandler {
    fn accept(&self, canister_id: &Principal, method: &str) -> bool;
    fn perform(
        &self,
        caller: &Principal,
        cycles: u64,
        canister_id: &Principal,
        method: &str,
        args_raw: &Vec<u8>,
        ctx: Option<&mut MockContext>
    ) -> (CallResult<Vec<u8>>, u64); }
Expand description

Anything that could be used to simulate a inter-canister call.

Required Methods

Whatever the handler can handle the given call or not, if this method returns false, we skip this handler and try to find the next handler that can handle the call.

Perform the call using this handler. Only called if accept() first returned true.

Implementors