Skip to content

Commit

Permalink
Use friendlier denom rather than asset IDs in error (#4593)
Browse files Browse the repository at this point in the history
  • Loading branch information
devanoneth authored Jun 12, 2024
1 parent cc72b3c commit 5569f6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/view/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,19 +576,19 @@ impl<R: RngCore + CryptoRng> Planner<R> {
}

let mut iterations = 0usize;
let asset_cache = view.assets().await?;

// Now iterate over the action list's imbalances to balance the transaction.
while let Some(required) = self.action_list.balance_with_fee().required().next() {
// Find a single note to spend towards the required balance.
let note = notes_by_asset_id
.get_mut(&required.asset_id)
.expect("we already made a notesrequest for each required asset")
.expect("we already made a notes request for each required asset")
.pop()
.ok_or_else(|| {
anyhow!(
"ran out of notes to spend while planning transaction, need {} of asset {}",
required.amount,
required.asset_id,
"ran out of notes to spend while planning transaction, need {}",
required.format(&asset_cache)
)
})?;

Expand Down

0 comments on commit 5569f6d

Please sign in to comment.