Files
tycho-execution/src/encoding/strategy_encoder.rs
Diana Carvalho 6c6ba21894 feat: Add evm feature gate
- Move all evm code inside evm directory
- StrategyEncoder:
  - Kept StrategyEncoder trait but created a new one: EVMStrategyEncoder to implement encode_protocol_header (that is evm specific).
  - All StrategyEncoders implement both traits now
  - Renamed DefaultStrategySelector -> EVMStrategySelector
- RouterEncoder:
  - Created a RouterEncoder trait and a EVMRouterEncoder that implements it
- Moved utils inside evm directory as well
- Renamed config.json -> executor_addresses.json and moved it to a higher config directory
- Make alloy optional and dependent on the evm feature gate

--- don't change below this line ---
ENG-4075 <#DTT#>
2025-01-17 12:52:39 +00:00

17 lines
446 B
Rust

use anyhow::Error;
use crate::encoding::models::{ActionType, Solution};
#[allow(dead_code)]
pub trait StrategyEncoder {
fn encode_strategy(&self, to_encode: Solution) -> Result<Vec<u8>, Error>;
fn action_type(&self, exact_out: bool) -> ActionType;
fn selector(&self, exact_out: bool) -> &str;
}
pub trait StrategySelector {
#[allow(dead_code)]
fn select_strategy(&self, solution: &Solution) -> Box<dyn StrategyEncoder>;
}