From 05a1843f9c3f916d4af8fbf67cccf3b3b94aeab8 Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Thu, 27 Feb 2025 12:39:16 +0000 Subject: [PATCH] fix: Add a value to the Transaction if token in is ETH not only if the action is unwrap --- don't change below this line --- ENG-4260 Took 11 minutes --- src/encoding/evm/tycho_encoder.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/encoding/evm/tycho_encoder.rs b/src/encoding/evm/tycho_encoder.rs index 48991d6..0937fe9 100644 --- a/src/encoding/evm/tycho_encoder.rs +++ b/src/encoding/evm/tycho_encoder.rs @@ -109,9 +109,10 @@ impl TychoEncoder for EVMTychoEncoder { .strategy_encoder .encode_strategy(solution.clone())?; - let value = match solution.native_action.as_ref() { - Some(NativeAction::Wrap) => solution.given_amount.clone(), - _ => BigUint::ZERO, + let value = if solution.given_token == self.native_address { + solution.given_amount.clone() + } else { + BigUint::ZERO }; transactions.push(Transaction {