Skip to content

Commit

Permalink
Check remaining amount is not 0 before proceeding (MystenLabs#7407)
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-koshy authored Jan 14, 2023
1 parent 293d455 commit 1217683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/sui-adapter/src/execution_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ fn debit_coins_and_transfer<S>(
for (recipient, amount) in recipients.iter().zip(amounts) {
let mut remaining_amount = *amount;
loop {
if remaining_amount == 0 {
break; // nothing to pay
}
// while remaining_amount != 0
// guaranteed to be in-bounds because of the total > total_coins check above
let coin = &mut coins[cur_coin_idx];
Expand Down

0 comments on commit 1217683

Please sign in to comment.