2

I have this error when compiling Week01 from Pioneer Program:

error:
• Couldn't match type ‘Either SomeCardanoApiTx Tx’ with ‘Tx’
  Expected type: Tx
    Actual type: CardanoTx
• In the first argument of ‘txId’, namely ‘ledgerTx’
  In the second argument of ‘($)’, namely ‘txId ledgerTx’
  In the second argument of ‘($)’, namely
    ‘awaitTxConfirmed $ txId ledgerTx’

void $ awaitTxConfirmed $ txId ledgerTx

How to fix the error?

1 Answer 1

3

You must have built Plutus from the latest commit, some things have changed I believe. The reason is submitTxConstraintsWith returns a type of Contract w s e CardanoTx but txId requires the type Tx. Replace TxId with getCardanoTxId and it should work.

If you want to follow the Pioneer Program tutorials you need to build with the commit hash used in the lectures, for lesson 1 it is: ea0ca4e9f9821a9dbfc5255fa0f42b6f2b3887c4

2
  • 1
    But I want to use a recent version. Dec 7, 2021 at 9:31
  • the getCardanoTxId fixed for me, thx!
    – Edwin
    Jan 6, 2022 at 10:47

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.