spacebudz / lucid

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
https://lucid.spacebudz.io
MIT License
336 stars 133 forks source link

Transaction submit error caused by filled datum and datumHash field #249

Open miksax opened 2 months ago

miksax commented 2 months ago

When you fill UTxO with both datum and datumHash field and datum is inline, the transaction will fail (Blockfrost error attached). There is no problem validating it inside lucid, but the final transaction expects a supplemental datum. If you remove the datum filed from UTxO, everything works as expected.

What about expanding the UTxO type with information about DatumType to fulfill valid transactions?

{
 "error":"Bad Request","message":"{\"contents\":{\"contents\":{\"contents\":{\"era\":\"ShelleyBasedEraBabbage\",\"error\":[{\"contents\":{\"contents\":{\"contents\":[[\"6820e9815d81b1ff6b87ff119841d13e753aadb52ccab189a55aa70c0f2446e0\",\"923918e403bf43c34b4ef6b48eb2ee04babed17320d8d1b9ff9ad086e86f44ec\"],[]],\"tag\":\"NotAllowedSupplementalDatums\"},\"tag\":\"AlonzoInBabbageUtxowPredFailure\"},\"tag\":\"UtxowFailure\"}],\"kind\":\"ShelleyTxValidationError\"},\"tag\":\"TxValidationErrorInCardanoMode\"},\"tag\":\"TxCmdTxSubmitValidationError\"},\"tag\":\"TxSubmitFail\"}","status_code":400}