2

If I have the following transaction:

cardano-cli transaction build                 \
--tx-in dd3dbc1cbd4627da3b74fae8c7bcc3f05f3b41ec36feb33f81cf885390b634d6#0      \
--tx-in 40917b278a9bf960fcc0a3de9eb5945113c025323d7d73c19dd6d26cfe92e04b#0      \
--tx-in e98a07b5ff0b048950ce4ffdfbfb53def61e2b52e9bf39cdd82b3eb91c40e2a6#0 \
--tx-in-script-file plutus/order-v11-buy-token.plutus   \
--tx-in-datum-file 'tmp/batch_datum_file_0.json'   \
--tx-in-redeemer-file 'plutus/match-order-redeemer.json'  \
--tx-in 2c759a6606692c021c266025cbd569a1b451e184fb44e001d18152528a3a2161#0 \
--tx-in-script-file plutus/order-v11-buy-token.plutus   \
--tx-in-datum-file 'tmp/batch_datum_file_1.json'   \
--tx-in-redeemer-file 'plutus/match-order-redeemer.json'  \
--tx-in cfbf555aebbf879e2313c32f4d8b839d63d7f7b12fd1027cb3ccd7e9f790e014#0 \
--tx-in-script-file plutus/order-v11-buy-ada.plutus   \
--tx-in-datum-file 'tmp/batch_datum_file_2.json'   \
--tx-in-redeemer-file 'plutus/match-order-redeemer.json'  

I am getting the following error:

Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with: 
The Plutus script evaluation failed: An error has occurred:  User error:
The provided Plutus code called 'error'.
Script debugging logs: 
the script for transaction input 4 (in the order of the TxIds) failed with: 
The Plutus script evaluation failed: An error has occurred:  User error:
The provided Plutus code called 'error'.

How to realize which scripts reported the error, it is saying the script for transaction input 0 and the script for transaction input 4 but with the above command, I cannot find on tx-in position 0 any script. How to determine the order of transaction input (in the order of the TxIds)?

1 Answer 1

1

Looks like all --tx-in is not in the order like it is provided in cardano-cli command and rather is order ascending by transaction id.

3
  • Not very intuitive behavior. Where did you find that answer?
    – eddex
    Commented Apr 21, 2022 at 15:48
  • I just guess it, and then I did sort utxos and that proved my assumption.
    – zarej
    Commented Apr 24, 2022 at 9:19
  • 1
    I created a PR in the cardano-node repo to make the errors more explicit: github.com/input-output-hk/cardano-node/pull/3811
    – eddex
    Commented Apr 25, 2022 at 14:41

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.