Files
tycho-execution/src/encoding/strategy_encoder.rs
Diana Carvalho 3dcb8aee7b chore: Use tycho_core::dto objects instead of tycho_core::models
--- don't change below this line ---
ENG-4169 Took 11 minutes
2025-02-05 10:10:43 +00:00

27 lines
779 B
Rust

use tycho_core::{dto::Chain, Bytes};
use crate::encoding::{errors::EncodingError, models::Solution, swap_encoder::SwapEncoder};
pub trait StrategyEncoder {
fn encode_strategy(
&self,
to_encode: Solution,
router_address: Bytes,
) -> Result<(Vec<u8>, Bytes), EncodingError>;
#[allow(clippy::borrowed_box)]
fn get_swap_encoder(&self, protocol_system: &str) -> Option<&Box<dyn SwapEncoder>>;
}
pub trait StrategyEncoderRegistry {
fn new(
chain: Chain,
executors_file_path: &str,
signer_pk: Option<String>,
) -> Result<Self, EncodingError>
where
Self: Sized;
#[allow(clippy::borrowed_box)]
fn get_encoder(&self, solution: &Solution) -> Result<&Box<dyn StrategyEncoder>, EncodingError>;
}