File tree Expand file tree Collapse file tree
cardano-api/test/cardano-api-test/Test/Cardano/Api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ genUnderfundedTx era = do
647647 return (Exp. makeUnsignedTx era txBodyContent, utxo, changeAddr)
648648
649649-- | A well-funded transaction (UTxO >> output + fee) always produces a
650- -- successful positive fee calculation .
650+ -- successful, fully balanced result with a positive fee.
651651prop_calcMinFeeRecursive_well_funded_succeeds :: Property
652652prop_calcMinFeeRecursive_well_funded_succeeds = H. property $ do
653653 (unsignedTx, utxo, changeAddr) <- H. forAll $ genFundedSimpleTx Exp. ConwayEra
@@ -656,6 +656,16 @@ prop_calcMinFeeRecursive_well_funded_succeeds = H.property $ do
656656 Right (Exp. UnsignedTx resultLedgerTx) -> do
657657 let resultFee = resultLedgerTx ^. L. bodyTxL . L. feeTxBodyL
658658 H. assert $ resultFee > L. Coin 0
659+ -- The resulting transaction must be fully balanced (zero balance).
660+ let balance =
661+ UnexportedLedger. evalBalanceTxBody
662+ exampleProtocolParams
663+ (const Nothing )
664+ (const Nothing )
665+ (const False )
666+ utxo
667+ (resultLedgerTx ^. L. bodyTxL)
668+ balance H. === mempty
659669
660670-- | 'calcMinFeeRecursive' is idempotent: applying it to its own result
661671-- yields the same 'UnsignedTx'. This confirms the fee has reached a
You can’t perform that action at this time.
0 commit comments