Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix "Gave up!" problem in prop_balanceTransactionUnresolvedInputs #3212

Merged
merged 3 commits into from
Apr 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions lib/shelley/test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2351,22 +2351,26 @@ prop_balanceTransactionUnresolvedInputs
-> ShowBuildable PartialTx
-> StdGenSeed
-> Property
prop_balanceTransactionUnresolvedInputs wallet (ShowBuildable partialTx')
seed = checkCoverage $ withMaxSuccess 400 $
forAll (dropResolvedInputs partialTx') $ \(partialTx, dropped) -> do
not (null dropped) ==> do
prop_balanceTransactionUnresolvedInputs wallet (ShowBuildable partialTx') seed =
checkCoverage
$ forAll (dropResolvedInputs partialTx') $ \(partialTx, dropped) -> do
let res = balanceTransaction' wallet seed partialTx
cover 1 (isUnresolvedTxInsErr res) "unknown txins" $
case res of
Right _
-> label "success" $ property True
-- Balancing can succeed if the dropped inputs happen
-- to be apart of the wallet UTxO.
| null dropped
-> label "nothing dropped"
$ property True
| otherwise
-> label "succeeded despite unresolved input"
$ property True
-- Balancing can succeed if the dropped inputs happen
-- to be apart of the wallet UTxO.
Anviking marked this conversation as resolved.
Show resolved Hide resolved
Left (ErrBalanceTxAssignRedeemers
(ErrAssignRedeemersUnresolvedTxIns _))
-> property True
Left _
-> property True
-> label "other error" $ property True
where
isUnresolvedTxInsErr
(Left (ErrBalanceTxAssignRedeemers
Expand Down