You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three Hedgehog properties in Test.Cardano.Api.Experimental verify the
key invariants of the recursive fee calculator:
- well-funded transaction always succeeds and produces a positive fee
- fee calculation is idempotent (result is a fixed point)
- underfunded transaction (outputs exceed inputs) always returns
NotEnoughAda with a negative deficit coin
Two lovelace-only generators drive the tests: one with
generous UTxO funding (5–20 ADA input, 1–3 ADA output) and one where
the output deliberately exceeds the input (0.5–2 ADA vs 5–10 ADA).
@@ -669,13 +672,9 @@ instance Error RecursiveFeeCalculationError where
669
672
, pretty balance
670
673
, "\nThis means that the transaction does not have enough ada to cover the fees. The usual solution is to provide more inputs, or inputs with more ada."
671
674
]
675
+
prettyError NoTxOuts=
676
+
"The transaction has no outputs. At least one output is required to balance the transaction."
672
677
673
-
-- The assumption here is that we are spending a single UTxO
674
-
-- When the fee changes we must also adjust the outputs.
675
-
-- We will make two outputs, one for the change (if any)
676
-
-- and one for the destination address.
677
-
-- Currently this still overestimates by 2332 lovelace
0 commit comments