pub mod stack;
use crate::{Config, Weight};
use fp_evm::{CallInfo, CreateInfo};
use sp_core::{H160, H256, U256};
use sp_std::vec::Vec;
#[derive(Debug)]
pub struct RunnerError<E: Into<sp_runtime::DispatchError>> {
pub error: E,
pub weight: Weight,
}
pub trait Runner<T: Config> {
type Error: Into<sp_runtime::DispatchError>;
fn validate(
source: H160,
target: Option<H160>,
input: Vec<u8>,
value: U256,
gas_limit: u64,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
access_list: Vec<(H160, Vec<H256>)>,
is_transactional: bool,
weight_limit: Option<Weight>,
proof_size_base_cost: Option<u64>,
evm_config: &evm::Config,
) -> Result<(), RunnerError<Self::Error>>;
fn call(
source: H160,
target: H160,
input: Vec<u8>,
value: U256,
gas_limit: u64,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
access_list: Vec<(H160, Vec<H256>)>,
is_transactional: bool,
validate: bool,
weight_limit: Option<Weight>,
proof_size_base_cost: Option<u64>,
config: &evm::Config,
) -> Result<CallInfo, RunnerError<Self::Error>>;
fn create(
source: H160,
init: Vec<u8>,
value: U256,
gas_limit: u64,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
access_list: Vec<(H160, Vec<H256>)>,
is_transactional: bool,
validate: bool,
weight_limit: Option<Weight>,
proof_size_base_cost: Option<u64>,
config: &evm::Config,
) -> Result<CreateInfo, RunnerError<Self::Error>>;
fn create2(
source: H160,
init: Vec<u8>,
salt: H256,
value: U256,
gas_limit: u64,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
access_list: Vec<(H160, Vec<H256>)>,
is_transactional: bool,
validate: bool,
weight_limit: Option<Weight>,
proof_size_base_cost: Option<u64>,
config: &evm::Config,
) -> Result<CreateInfo, RunnerError<Self::Error>>;
}