pub trait CallInterceptor<T: Config> {
    // Required method
    fn intercept_call(
        contract_address: &T::AccountId,
        entry_point: &ExportedFunction,
        input_data: &[u8]
    ) -> Option<ExecResult>;
}
Expand description

Provides an interface for intercepting contract calls.

Required Methods§

source

fn intercept_call( contract_address: &T::AccountId, entry_point: &ExportedFunction, input_data: &[u8] ) -> Option<ExecResult>

Allows to intercept contract calls and decide whether they should be executed or not. If the call is intercepted, the mocked result of the call is returned.

§Arguments
  • contract_address - The address of the contract that is about to be executed.
  • entry_point - Describes whether the call is the constructor or a regular call.
  • input_data - The raw input data of the call.
§Expected behavior

This method should return:

  • Some(ExecResult) - if the call should be intercepted and the mocked result of the call is returned.
  • None - otherwise, i.e. the call should be executed normally.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Config> CallInterceptor<T> for ()

source§

fn intercept_call( _contract_address: &T::AccountId, _entry_point: &ExportedFunction, _input_data: &[u8] ) -> Option<ExecResult>

Implementors§