4

Under what conditions does awaitTxConfirmed not return?

It stopped returning since I updated my cabal.project file to make use of the latest plutus tag plutus-starter-devcontainer/v1.0.7. It worked with plutus-starter-devcontainer/v1.0.6.

The changes that had to be made were as trivial as changing ByteString to BuiltinByteString, mustForgeValue to mustMintValue etc.

The test output looks like:

...
Slot 00003: W1: TxSubmit: b7c6004fe8f4b8cdf94c9b4b3260f4bc60ae4c9fa6ec9d64e4b8f5e4e9c83c5b
Slot 00003: SlotAdd Slot 4
Slot 00004: SlotAdd Slot 5
...
1
  • can you post your code where you are actually using awaitTxConfirmed?
    – Matthias Sieber
    Sep 23, 2021 at 4:25

1 Answer 1

1

Your answer is found in the Plutus.Contract.Request module of plutus-contract.

It says that: "If the transaction is never added to the ledger then 'awaitTxConfirmed' never returns".

5
  • You are right about the comment, but it doesn't explain the reason why awaitTxConfirmed would not return
    – Aoaddeola
    Aug 24, 2021 at 13:47
  • 1
    awaitTxConfirmed won't return because if loops indefinitely. If you look at the implementation, it stops looping only when the status of the tx is something other than Unknown.
    – kolam
    Aug 24, 2021 at 14:16
  • This doesn't explain it, since the awaitTxConfirmed isn't recursive
    – Aoaddeola
    Aug 24, 2021 at 14:18
  • 1
    You see the go function inside awaitTxConfirmed? It's recursive no?
    – kolam
    Aug 24, 2021 at 14:30
  • Ok, you are right about the recursion... But still, it doesn't tell why it may loop indefinitely :) I'd like to believe that the answer might have more to do with general blockchain documentation and not what can be discerned from code. I might be wrong though
    – Aoaddeola
    Aug 24, 2021 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.