Skip to content

Commit

Permalink
Update toolkit/offchain/src/csl.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Klapeyron <[email protected]>
  • Loading branch information
AmbientTea and Klapeyron authored Jan 22, 2025
1 parent a8e4ccd commit fa8a9b3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions toolkit/offchain/src/csl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,14 @@ impl TransactionBuilderExt for TransactionBuilder {
try_balance(self, &selected, ctx)
.map_err(|e| JsError::from_str(&format!("Could not balance transaction. Usually it means that the payment key does not own UTXO set required to cover transaction outputs and fees or to provide collateral. Cause: {}", e)))?;

#[cfg(test)]
{
assert!(
balanced_transaction.body().collateral().is_some(),
"BUG: Balanced transaction should have collateral set."
);
assert!(
balanced_transaction.body().collateral_return().is_some(),
"BUG: Balanced transaction should have collateral returned."
);
}
debug_assert!(
balanced_transaction.body().collateral().is_some(),
"BUG: Balanced transaction should have collateral set."
);
debug_assert!(
balanced_transaction.body().collateral_return().is_some(),
"BUG: Balanced transaction should have collateral returned."
);

Ok(balanced_transaction)
}
Expand Down

0 comments on commit fa8a9b3

Please sign in to comment.