From a59a6f4b2f582ec18439e0c65b87bf9c7693709d Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 15 Nov 2023 13:45:50 +0200 Subject: [PATCH] router multi pair swap return type --- dex/router/src/multi_pair_swap.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index e537beed9..940b8a272 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -15,7 +15,10 @@ pub const SWAP_TOKENS_FIXED_OUTPUT_FUNC_NAME: &[u8] = b"swapTokensFixedOutput"; pub trait MultiPairSwap: factory::FactoryModule + token_send::TokenSendModule { #[payable("*")] #[endpoint(multiPairSwap)] - fn multi_pair_swap(&self, swap_operations: MultiValueEncoded>) { + fn multi_pair_swap( + &self, + swap_operations: MultiValueEncoded>, + ) -> ManagedVec { let (token_id, nonce, amount) = self.call_value().single_esdt().into_tuple(); require!(nonce == 0, "Invalid nonce. Should be zero"); require!(amount > 0u64, "Invalid amount. Should not be zero"); @@ -61,6 +64,8 @@ pub trait MultiPairSwap: factory::FactoryModule + token_send::TokenSendModule { payments.push(last_payment); self.send().direct_multi(&caller, &payments); + + payments } fn actual_swap_fixed_input(