Skip to content

Commit

Permalink
Fix erroneous assertion in onOutputsInsufficient.
Browse files Browse the repository at this point in the history
This assertion should have been negated.

The error was only revealed once we had deliberately tweaked the
generator to generate selection criteria with some minted values
that are not spent or burned.
  • Loading branch information
jonathanknowles committed Jul 8, 2021
1 parent f8d1777 commit 36b2be9
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -996,22 +996,24 @@ prop_performSelection minCoinValueFor costFor (Blind criteria) coverage =

onOutputsInsufficient e = do
monitor $ counterexample $ unlines
[ "minted values:"
, pretty (Flat errorMintedValues)
, "burned values:"
, pretty (Flat errorBurnedValues)
, "requested assets to cover:"
, pretty (Flat requestedOutputAssets)
, "values minted but not spent or burned:"
[ "assets to mint:"
, pretty (Flat errorAssetsToMint)
, "assets to burn:"
, pretty (Flat errorAssetsToBurn)
, "requested output assets:"
, pretty (Flat errorRequestedOutputAssets)
, "assets minted but not spent or burned:"
, pretty (Flat $ missingOutputAssets e)
]
assert $ errorMintedValues
`leq` (requestedOutputAssets `TokenMap.add` errorBurnedValues)
assert $ errorAssetsToMint == assetsToMint
assert $ errorAssetsToBurn == assetsToBurn
assert
$ not
$ errorAssetsToMint
`leq` (errorRequestedOutputAssets <> errorAssetsToBurn)
where
OutputsInsufficientError
errorMintedValues
errorBurnedValues
requestedOutputAssets = e
errorAssetsToMint errorAssetsToBurn errorRequestedOutputAssets = e

onInsufficientMinCoinValues es = do
monitor $ counterexample $ unlines
Expand Down

0 comments on commit 36b2be9

Please sign in to comment.