revm_handler_interface::post_execution

Trait PostExecutionHandler

Source
pub trait PostExecutionHandler {
    type Context;
    type Error;
    type ExecResult;
    type Output;

    // Required methods
    fn refund(
        &self,
        context: &mut Self::Context,
        exec_result: &mut Self::ExecResult,
        eip7702_refund: i64,
    );
    fn reimburse_caller(
        &self,
        context: &mut Self::Context,
        exec_result: &mut Self::ExecResult,
    ) -> Result<(), Self::Error>;
    fn reward_beneficiary(
        &self,
        context: &mut Self::Context,
        exec_result: &mut Self::ExecResult,
    ) -> Result<(), Self::Error>;
    fn output(
        &self,
        context: &mut Self::Context,
        result: Self::ExecResult,
    ) -> Result<Self::Output, Self::Error>;
    fn clear(&self, context: &mut Self::Context);

    // Provided method
    fn end(
        &self,
        _context: &mut Self::Context,
        end_output: Result<Self::Output, Self::Error>,
    ) -> Result<Self::Output, Self::Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn refund( &self, context: &mut Self::Context, exec_result: &mut Self::ExecResult, eip7702_refund: i64, )

Calculate final refund

Source

fn reimburse_caller( &self, context: &mut Self::Context, exec_result: &mut Self::ExecResult, ) -> Result<(), Self::Error>

Reimburse the caller with balance it didn’t spent.

Source

fn reward_beneficiary( &self, context: &mut Self::Context, exec_result: &mut Self::ExecResult, ) -> Result<(), Self::Error>

Reward beneficiary with transaction rewards.

Source

fn output( &self, context: &mut Self::Context, result: Self::ExecResult, ) -> Result<Self::Output, Self::Error>

Main return handle, takes state from journal and transforms internal result to PostExecutionHandler::Output.

Source

fn clear(&self, context: &mut Self::Context)

Clean handler. This handle is called every time regardless of the result of the transaction.

Provided Methods§

Source

fn end( &self, _context: &mut Self::Context, end_output: Result<Self::Output, Self::Error>, ) -> Result<Self::Output, Self::Error>

Called when execution ends.

End handle in comparison to output handle will be called every time after execution. While PostExecutionHandler::output will be omitted in case of the error.

Implementors§