Before the 2022-04-06 PAB Release
Contracts used to stop execution after validation script failed the transaction sent by
submitTxConstraintsWith, but after this release
Contract is not stopping its execution anymore and it's just proceeding to the end.
The suspected change which caused this changed behavior is this one https://github.com/input-output-hk/plutus-apps/pull/360/files
I need to update our code base to accommodate this recent change in behavior in
ledgerTx <- submitTxConstraintsWith @Void lookups tx
logInfo @String $ "In case if validation fails, this line was not reachable before 2022-04-06 release, but now it is"
There is some logic follows after
submitTxConstraintsWith called, that logic should not be executed in case if validation script fails.
What would be the best way to check if validator script failed the transaction to throw an error and make the Contract return?