Function drink_next::mock_message
source · pub fn mock_message<Args: Decode, Ret: Encode, Body: Fn(Args) -> Ret + Send + Sync + 'static>(
body: Body
) -> MessageMock
Expand description
A helper function to create a message mock out of a typed closure.
In particular, it takes care of decoding the input and encoding the output. Also, wraps the
return value in a Result
, which is normally done implicitly by ink!.