fix: Post merge's fixes

Because of the renaming, git couldn't identify the new files and handle the conflicts gracefully.
Copied implementation for ExecutorStrategyEncoder from main

Rollbacked on decision to encode the executor address and selector inside the SwapEncoders. This is only necessary for certain strategies. So it should be done at the strategy level

--- don't change below this line ---
ENG-4081 Took 35 minutes
This commit is contained in:
Diana Carvalho
2025-01-30 19:38:22 +00:00
parent 01df08deaa
commit a28b54888e
5 changed files with 113 additions and 58 deletions

View File

@@ -2,9 +2,7 @@ use tycho_core::models::Chain;
use crate::encoding::{
errors::EncodingError,
evm::strategy_encoder::strategy_encoders::{
SplitSwapStrategyEncoder, StraightToPoolStrategyEncoder,
},
evm::strategy_encoder::strategy_encoders::{ExecutorStrategyEncoder, SplitSwapStrategyEncoder},
models::Solution,
strategy_encoder::{StrategyEncoder, StrategySelector},
};
@@ -18,8 +16,8 @@ impl StrategySelector for EVMStrategySelector {
signer: Option<String>,
chain: Chain,
) -> Result<Box<dyn StrategyEncoder>, EncodingError> {
if solution.straight_to_pool {
Ok(Box::new(StraightToPoolStrategyEncoder {}))
if solution.direct_execution {
Ok(Box::new(ExecutorStrategyEncoder {}))
} else {
let signer_pk = signer.ok_or_else(|| {
EncodingError::FatalError(