cfx_executor/executive/
transact_options.rs1use crate::executive_observer::ExecutiveObserver;
2
3pub struct TransactOptions<O: ExecutiveObserver> {
5 pub observer: O,
6 pub settings: TransactSettings,
7}
8
9impl Default for TransactOptions<()> {
10 fn default() -> Self {
11 Self {
12 observer: (),
13 settings: TransactSettings::all_checks(),
14 }
15 }
16}
17
18#[derive(Debug, Clone, Copy)]
19pub struct TransactSettings {
20 pub charge_collateral: ChargeCollateral,
21 pub charge_gas: bool,
22 pub check_base_price: bool,
23 pub check_epoch_bound: bool,
24 pub forbid_eoa_with_code: bool,
25}
26
27#[derive(Debug, Clone, Copy)]
28pub enum ChargeCollateral {
29 Normal,
31 EstimateSender,
34 EstimateSponsor,
37}
38
39impl TransactSettings {
40 pub fn all_checks() -> Self {
41 Self {
42 charge_collateral: ChargeCollateral::Normal,
43 charge_gas: true,
44 check_epoch_bound: true,
45 check_base_price: true,
46 forbid_eoa_with_code: true,
47 }
48 }
49}