4

I tried to equip the EnglishAuction.hs contract from Plutus Pioneer Program week 01 with test routine designed according to what Lars presented in later lectures:

doTest :: IO()
doTest = runEmulatorTraceIO $ do
    let startParams = StartParams{spDeadline = 10, spMinBid = 5, spCurrency = "Token", spToken = myTokenName}
    h1 <- activateContractWallet (Wallet 1) endpoints
--    h2 <- activateContractWallet (Wallet 2) endpoints
    callEndpoint @"start" h1 startParams
    void $ Emulator.waitNSlots 1

Then, however, I get a strange error which is caused by a line calling activateContractWallet. The message is mysterious and to me it carries no information:

Prelude Week01.EnglishAuction> Week01.EnglishAuction.doTest
*** Exception: not a hexit: 'T'
CallStack (from HasCallStack):
  error, called at src/Data/Either/Extras.hs:6:34 in plutus-ledger-api-0.1.0.0-307e91a82e48dc52f16a2602ae259f767995000a894e765e9c2a3c51ae53abfc:Data.Either.Extras

The full source of my modifications is here: https://gist.github.com/emesik/82f185dad3ecec6ec811530db4c51ff1

edit: I see the error is caused by "Token" used as spCurrency. Haskell expects hexadecimal there, perhaps the ID of minting policy? How can I fix it?

1
  • Plutus is still in development. So while the Plutus Pioneer Program is taking place, things were expected to break. I think the first three weeks or so will not run with the updated Plutus Playground. There may be community contributions that modify the source to work with the current Plutus implementation.
    – Matthias Sieber
    Jun 8 at 1:33
3

Currency symbols can't be arbitrary byte strings, they must consist of hexadecimal digits. So you can't use Token, and the error message is complaining about the T. Use something like ff instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.