From aba280acd084b1573a17cd5db7e1bb5875ee53c9 Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Tue, 22 Apr 2025 17:30:04 +0100 Subject: [PATCH] feat: Update tycho-encode bin with new arguments --- don't change below this line --- ENG-4446 Took 51 minutes Took 9 seconds --- src/bin/tycho-encode.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/tycho-encode.rs b/src/bin/tycho-encode.rs index 1edefd7..b054506 100644 --- a/src/bin/tycho-encode.rs +++ b/src/bin/tycho-encode.rs @@ -44,11 +44,15 @@ pub struct Cli { #[command(subcommand)] pub command: Commands, #[arg(short, long)] + chain: Chain, + #[arg(short, long)] executors_file_path: Option, #[arg(short, long)] router_address: Option, #[arg(short, long)] swapper_pk: Option, + #[arg(short, long)] + token_in_already_in_router: Option, } #[derive(Subcommand)] @@ -61,8 +65,6 @@ pub enum Commands { fn main() -> Result<(), Box> { let cli = Cli::parse(); - let chain = Chain::Ethereum; - // Read from stdin until EOF let mut buffer = String::new(); io::stdin() @@ -74,6 +76,7 @@ fn main() -> Result<(), Box> { } let solution: Solution = serde_json::from_str(&buffer)?; + let chain = cli.chain; let encoder: Box = match cli.command { Commands::TychoRouter => { let mut builder = TychoRouterEncoderBuilder::new().chain(chain); @@ -86,6 +89,9 @@ fn main() -> Result<(), Box> { if let Some(swapper_pk) = cli.swapper_pk { builder = builder.swapper_pk(swapper_pk); } + if let Some(token_in_already_in_router) = cli.token_in_already_in_router { + builder = builder.token_in_already_in_router(token_in_already_in_router); + } builder.build()? } Commands::TychoExecutor => TychoExecutorEncoderBuilder::new()