From ba11a616091d74759e7941fcb6da2ec2f66ebd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 22 Nov 2023 15:49:56 +0200 Subject: [PATCH 1/2] Test1 --- contracts/paymaster/src/forward_call.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/paymaster/src/forward_call.rs b/contracts/paymaster/src/forward_call.rs index 9410e1ed..03a60e02 100644 --- a/contracts/paymaster/src/forward_call.rs +++ b/contracts/paymaster/src/forward_call.rs @@ -32,6 +32,9 @@ pub trait ForwardCall { ) -> MultiValueEncoded { // TODO: use ManagedGetBackTransfers once rc1.6 is activated let back_transfers = self.blockchain().get_back_transfers(); + let payments = self.call_value().all_esdt_transfers(); + + self.send().direct_multi(&original_caller, &payments.clone_value()); // Send the original input tokens back to the original caller if !back_transfers.esdt_payments.is_empty() { From e2086b27c71818410f78a7d86236f230c4cfcd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 23 Nov 2023 13:16:05 +0200 Subject: [PATCH 2/2] Paymaster fix --- contracts/paymaster/src/forward_call.rs | 5 +---- contracts/paymaster/src/paymaster.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/contracts/paymaster/src/forward_call.rs b/contracts/paymaster/src/forward_call.rs index 03a60e02..955e59f7 100644 --- a/contracts/paymaster/src/forward_call.rs +++ b/contracts/paymaster/src/forward_call.rs @@ -10,8 +10,8 @@ pub trait ForwardCall { &self, dest: ManagedAddress, endpoint_name: ManagedBuffer, - endpoint_args: MultiValueEncoded, payments: PaymentsVec, + endpoint_args: MultiValueEncoded, ) { let original_caller = self.blockchain().get_caller(); @@ -32,9 +32,6 @@ pub trait ForwardCall { ) -> MultiValueEncoded { // TODO: use ManagedGetBackTransfers once rc1.6 is activated let back_transfers = self.blockchain().get_back_transfers(); - let payments = self.call_value().all_esdt_transfers(); - - self.send().direct_multi(&original_caller, &payments.clone_value()); // Send the original input tokens back to the original caller if !back_transfers.esdt_payments.is_empty() { diff --git a/contracts/paymaster/src/paymaster.rs b/contracts/paymaster/src/paymaster.rs index a5527945..d50bf875 100644 --- a/contracts/paymaster/src/paymaster.rs +++ b/contracts/paymaster/src/paymaster.rs @@ -33,6 +33,6 @@ pub trait PaymasterContract: forward_call::ForwardCall { let mut payments_without_fee = payments.clone_value(); payments_without_fee.remove(FEE_PAYMENT); - self.forward_call(dest, endpoint_name, endpoint_args, payments_without_fee); + self.forward_call(dest, endpoint_name, payments_without_fee, endpoint_args); } }