Skip to content

Commit

Permalink
unified syntax - add transfer_non_zero and replace multi_esdt_transfe…
Browse files Browse the repository at this point in the history
…r_execute
  • Loading branch information
BiancaIalangi committed Mar 22, 2024
1 parent e8ce466 commit c374bfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 5 additions & 7 deletions contracts/feature-tests/composability/forwarder/src/esdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ pub trait ForwarderEsdtModule: storage::ForwarderStorageModule {
all_token_payments.push(payment);
}

let _ = self.send_raw().multi_esdt_transfer_execute(
&to,
&all_token_payments,
self.blockchain().get_gas_left(),
&ManagedBuffer::new(),
&ManagedArgBuffer::new(),
);
self.tx()
.with_gas_limit(self.blockchain().get_gas_left())
.to(&to)
.multi_esdt(all_token_payments)
.transfer_execute();
}

#[payable("EGLD")]
Expand Down
8 changes: 8 additions & 0 deletions framework/base/src/types/interaction/tx_call_te.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,12 @@ where
pub fn transfer(self) {
self.transfer_execute_with_gas(0)
}

pub fn transfer_non_zero(self) {
if self.payment.is_no_payment() {
return;
}

self.transfer_execute_with_gas(0)
}
}

0 comments on commit c374bfc

Please sign in to comment.