Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 22:00 UTC
fix(decimal): handle all-zero closing exposures without TypeError
davoodmehraban89 committed
Oct 31, 2026 at 00:35 UTC
5482711aea5768bb241196176e55c7c88ea1a377
1 file changed
+1
-1
backend/src/aram_backend/coverage_preview.py
+1
-1
@@ -294,7 +294,7 @@ def preview_mapping_coverage(
294
))
295
296
# Exact decimal aggregation, including mixed tiny and huge balances.
297
- positive_digits = max(1, *(amount.adjusted() + 1 for amount in all_amounts if amount))
297
+ positive_digits = max((amount.adjusted() + 1 for amount in all_amounts if amount), default=1)
298
fractional_digits = max(0, *(-amount.as_tuple().exponent for amount in all_amounts))
299
precision = max(100, positive_digits + fractional_digits + len(str(len(all_amounts))) + 4)
300
with localcontext() as ctx: