Skip to content

Commit

Permalink
Merge pull request #209 from multiversx/switch-if-branches
Browse files Browse the repository at this point in the history
switch if branches
  • Loading branch information
dragos-rebegea authored Sep 12, 2024
2 parents 3a74ccf + 63af6f3 commit 523952d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions esdt-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,7 @@ pub trait EsdtSafe:
};

let batch_id = self.add_to_batch(tx.clone());
if !self.mint_burn_token(&payment_token).get() {
self.total_balances(&payment_token).update(|total| {
*total += &actual_bridged_amount;
});
} else {
if self.mint_burn_token(&payment_token).get() {
let burn_balances_mapper = self.burn_balances(&payment_token);
let mint_balances_mapper = self.mint_balances(&payment_token);
if !self.native_token(&payment_token).get() {
Expand All @@ -279,6 +275,10 @@ pub trait EsdtSafe:
burn_balances_mapper.update(|burned| {
*burned += &actual_bridged_amount;
});
} else {
self.total_balances(&payment_token).update(|total| {
*total += &actual_bridged_amount;
});
}
self.create_transaction_event(
batch_id,
Expand Down

0 comments on commit 523952d

Please sign in to comment.