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?