Skip to content

Commit bf80309

Browse files
committed
Fix flaky MultiAssetReturnCollateral test
Use retryUntilJustM to poll for the multi-asset UTxO instead of waiting a fixed 1 block and querying once. The mint transaction may not be confirmed within a single block, causing findLargestMultiAssetUtxoWithAddress to return Nothing. This matches the retry pattern already used for the script address UTxO lookup a few lines below.
1 parent 58f0953 commit bf80309

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/MultiAssetReturnCollateral.hs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,9 @@ hprop_collateral_with_tokens = integrationWorkspace "collateral-with-tokens" $ \
145145
-- STEP 2: Attempt to spend from script with collateral containing tokens
146146
-- This will fail because collateral cannot contain non-ADA tokens
147147

148-
-- Wait for transactions to be processed and find UTxOs
149-
_ <- waitForBlocks epochStateView 1
150-
151-
-- Find the UTxO with tokens at wallet1 (for collateral)
152-
txinCollateralWithTokensM <-
148+
-- Find the UTxO with tokens at wallet2 (for collateral)
149+
(txinCollateralWithTokens, collateralTxOut) <- retryUntilJustM epochStateView (WaitForBlocks 10) $
153150
findLargestMultiAssetUtxoWithAddress epochStateView sbe $ T.pack maCollateralAddress
154-
(txinCollateralWithTokens, collateralTxOut) <- H.evalMaybe txinCollateralWithTokensM
155151
H.note_ "Collateral TxOut"
156152
H.noteShow_ collateralTxOut
157153
-- Find the UTxO at the script address

0 commit comments

Comments
 (0)