pub trait EstimateGasAdapter {
    // Required method
    fn adapt_request(request: CallRequest) -> CallRequest;
}
Expand description

Allow to adapt a request for estimate_gas. Can be used to estimate gas of some contracts using a different function in the case the normal gas estimation doesn’t work.

Exemple: a precompile that tries to do a subcall but succeeds regardless of the success of the subcall. The gas estimation will thus optimize the gas limit down to the minimum, while we want to estimate a gas limit that will allow the subcall to have enough gas to succeed.

Required Methods§

source

fn adapt_request(request: CallRequest) -> CallRequest

Implementations on Foreign Types§

source§

impl EstimateGasAdapter for ()

source§

fn adapt_request(request: CallRequest) -> CallRequest

Implementors§