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