Type Definition concordium_std::ReceiveResult [−][src]
Expand description
The expected return type of the receive method of a smart contract.
Optionally, to define a custom type for error instead of using Reject, allowing to track the reason for rejection, but only in unit tests.
See also the documentation for bail! for how to use custom error types.
Example
Defining a custom error type
enum MyCustomError {
SomeError
}
#[receive(contract = "mycontract", name = "receive")]
fn contract_receive<R: HasReceiveContext, L: HasLogger, A: HasActions>(
ctx: &R,
receive_amount: Amount,
logger: &mut L,
state: &mut State,
) -> Result<A, MyCustomError> { ... }