mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-02 11:54:05 +01:00
De-panic output_amounts(): fallible make-outputs parsing
OutputSelectionArgs::output_amounts() unwrap()'d the float parse of each make-outputs value, panicking on bad input via the API path (the CLI now validates earlier). Return Result instead; sum_output_amounts() propagates. num_custom_outputs() now counts CSV entries without parsing, so it stays infallible and the debug! macros that use it are unaffected.
This commit is contained in:
@@ -137,7 +137,7 @@ fn contract_self_spend_custom_tx_impl(test_dir: &'static str) -> Result<(), libw
|
||||
assert_eq!(
|
||||
commits[15].output.value,
|
||||
3 * consensus::REWARD
|
||||
- selection_args.sum_output_amounts()
|
||||
- selection_args.sum_output_amounts()?
|
||||
- my_fee_contribution(3, 6, 1, 1)?.fee()
|
||||
);
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user