How to know if a transaction (tx) succeed or fail after awaitTxConfirmed
? Is there any function to get a tx on-chain by TxId
?
1 Answer
awaitTxConfirmed
is actually part of the off-chain code, so your computer is checking the chain to see if the transaction has become part of the ledger.
Sadly, right now awaitTxConfirmed
does not know that a transaction has failed and if it did fail, your smart contact would be blocked, unless you introduce a logic to time out if your transaction is not included in the ledger for some amount of blocks for example.
However, I know the plutus team is working to solve this and we might have this functionality soon in Plutus.