Files
tycho-execution/src/encoding/strategy_encoder.rs
Diana Carvalho 6e8d2ede59 feat: Simplify router encoder
Don't make selector() a member of the StrategyEncoder trait. It is needed only for certain strategies. The strategy should manage it itself.

--- don't change below this line ---
ENG-4081 Took 17 minutes
2025-01-30 15:19:09 +00:00

23 lines
538 B
Rust

use tycho_core::{models::Chain, Bytes};
use crate::encoding::{errors::EncodingError, models::Solution};
#[allow(dead_code)]
pub trait StrategyEncoder {
fn encode_strategy(
&self,
to_encode: Solution,
router_address: Bytes,
) -> Result<Vec<u8>, EncodingError>;
}
pub trait StrategySelector {
#[allow(dead_code)]
fn select_strategy(
&self,
solution: &Solution,
signer_pk: Option<String>,
chain_id: Chain,
) -> Result<Box<dyn StrategyEncoder>, EncodingError>;
}