File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -196,8 +196,6 @@ awaitTxStatusChange contractEnv txId = do
196196 let status = transactionStatus blk txState txId
197197 pure $ fromRight Unknown status
198198 where
199- -- Attempts to find the tx in chain index. If the tx does not appear after
200- -- 5 blocks we give up
201199 queryChainIndexForTxState :: Eff effs (Maybe TxIdState )
202200 queryChainIndexForTxState = do
203201 mTx <- join . preview _TxIdResponse <$> (queryChainIndex @ w $ TxFromTxId txId)
Original file line number Diff line number Diff line change @@ -9,16 +9,20 @@ import Plutus.Contract.Types (Contract, throwError)
99import Prelude
1010
1111awaitTxConfirmedUntilSlot :: forall w s e . (AsContractError e ) => TxId -> Slot -> Contract w s e ()
12- awaitTxConfirmedUntilSlot i maxSlot = go 0
12+ awaitTxConfirmedUntilSlot txId maxSlot = go 0
1313 where
1414 go :: Integer -> Contract w s e ()
1515 go n = do
16- mTx <- awaitTxStatusChange i
16+ mTx <- awaitTxStatusChange txId
1717 case mTx of
1818 Unknown -> do
1919 curSlot <- currentSlot
20- if curSlot >= maxSlot
21- then throwError @ e $ review _OtherContractError $ pack $ " Could not find tx after maxAttempts. ID: " ++ show i
20+ if curSlot > maxSlot
21+ then
22+ throwError @ e $
23+ review _OtherContractError $
24+ pack $
25+ " Could not find transaction - " ++ show txId ++ " - before slot " ++ show maxSlot
2226 else do
2327 _ <- waitNSlots 20
2428 go (n + 1 )
You can’t perform that action at this time.
0 commit comments