feat: Add clone to EVMTychoEncoder

--- don't change below this line ---
ENG-4088 Took 4 minutes

Took 8 seconds

Took 48 seconds
This commit is contained in:
Diana Carvalho
2025-02-06 11:49:11 +00:00
parent 4680a4be24
commit b333d60d69
6 changed files with 32 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ use crate::encoding::{
/// * `router_address`: Bytes, the address of the router to use to execute the swaps.
/// * `native_address`: Address of the chain's native token
/// * `wrapped_address`: Address of the chain's wrapped native token
#[derive(Clone)]
pub struct EVMTychoEncoder<S: StrategyEncoderRegistry> {
strategy_registry: S,
router_address: Bytes,
@@ -183,6 +184,7 @@ mod tests {
}
}
#[derive(Clone)]
struct MockStrategy;
impl StrategyEncoder for MockStrategy {
@@ -202,6 +204,9 @@ mod tests {
fn get_swap_encoder(&self, _protocol_system: &str) -> Option<&Box<dyn SwapEncoder>> {
None
}
fn clone_box(&self) -> Box<dyn StrategyEncoder> {
Box::new(self.clone())
}
}
fn get_mocked_tycho_encoder() -> EVMTychoEncoder<MockStrategyRegistry> {