From f668405802716a1995882d3fffbf39d175fd24b6 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 1 Aug 2024 13:52:54 +0300 Subject: [PATCH] farm supply on claim fix for farm with locked rew --- dex/farm-with-locked-rewards/src/lib.rs | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 84d7dc7f4..e03cb80fe 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -127,30 +127,19 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); - let payments = self.call_value().all_esdt_transfers().clone_value(); - let base_claim_rewards_result = - self.claim_rewards_base::>(orig_caller.clone(), payments); - let output_farm_token_payment = base_claim_rewards_result.new_farm_token.payment.clone(); - self.send_payment_non_zero(&caller, &output_farm_token_payment); + let claim_rewards_result = self.claim_rewards::>(orig_caller.clone()); - let rewards_payment = base_claim_rewards_result.rewards; + self.send_payment_non_zero(&caller, &claim_rewards_result.new_farm_token); + + let rewards_payment = claim_rewards_result.rewards; let locked_rewards_payment = self.send_to_lock_contract_non_zero( rewards_payment.token_identifier, rewards_payment.amount, caller, - orig_caller.clone(), - ); - - self.emit_claim_rewards_event::<_, FarmTokenAttributes>( - &orig_caller, - base_claim_rewards_result.context, - base_claim_rewards_result.new_farm_token, - locked_rewards_payment.clone(), - base_claim_rewards_result.created_with_merge, - base_claim_rewards_result.storage_cache, + orig_caller, ); - (output_farm_token_payment, locked_rewards_payment).into() + (claim_rewards_result.new_farm_token, locked_rewards_payment).into() } #[payable("*")]