Files
tycho-execution/src/encoding/tycho_encoder.rs
TAMARA LIPOWSKI 58e8e67494 chore: dummy commit
CI won't run
2025-04-30 20:24:21 -04:00

21 lines
805 B
Rust

use crate::encoding::{
errors::EncodingError,
models::{Solution, Transaction},
};
/// A high-level encoder that converts solutions into executable transactions. Allows for modularity
/// in the encoding process.
pub trait TychoEncoder {
/// Encodes solutions into transactions that can be executed by the Tycho router.
///
/// # Arguments
/// * `solutions` - Vector of solutions to encode, each potentially using different setups (swap
/// paths, protocols, wrapping, etc.)
///
/// # Returns
/// * `Result<Vec<Transaction>, EncodingError>` - Vector of executable transactions
fn encode_calldata(&self, solutions: Vec<Solution>) -> Result<Vec<Transaction>, EncodingError>;
fn validate_solution(&self, solution: &Solution) -> Result<(), EncodingError>;
}