1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mod ds_proxy;
pub use ds_proxy::DsProxy;
mod middleware;
pub use middleware::TransformerMiddleware;
use ethers_contract::AbiError;
use ethers_core::{abi::ParseError, types::transaction::eip2718::TypedTransaction};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum TransformerError {
#[error("The field `{0}` is missing")]
MissingField(String),
#[error(transparent)]
AbiParseError(#[from] ParseError),
#[error(transparent)]
AbiError(#[from] AbiError),
}
pub trait Transformer: Send + Sync + std::fmt::Debug {
fn transform(&self, tx: &mut TypedTransaction) -> Result<(), TransformerError>;
}