I am new to haskell and I am trying to run a few expressions from the English Auction Contract in the repl.
So if I want to run ValidatorHash "f"
from the second last line of the Contract in week01, how do I do it in the repl here [nix-shell:~/plutus-pioneer-program/code/week01]$ cabal repl
?
What I tried
> import Ledger.ValidatorHash
> Ledger.ValidatorHash "f"
error: Couldn't match expected type ‘PlutusTx.Builtins.Internal.BuiltinByteString’
with actual type ‘[Char]’
then
> import PlutusTx.Builtins.Internal
> Ledger.ValidatorHash (BuiltinByteString "f")
error: Couldn't match expected type ‘bytestring-0.10.12.0:Data.ByteString.Internal.ByteString’
with actual type ‘[Char]’
then
> import Data.ByString as BS
error: Could not find module ‘Data.ByString’
Perhaps you meant
Data.ByteString (needs flag -package-key bytestring-0.10.12.0)
Data.String (from base-4.14.1.0)
So do I really need to close this repl and figure out the way to open the repl with the flag? Or is there something very obvious that I am missing?
Edit 1#1: added non-typo error for bytestring
> import Data.ByteString as BS
error: Could not load module ‘Data.ByteString’
It is a member of the hidden package ‘bytestring-0.10.12.0’.
Perhaps you need to add ‘bytestring’ to the build-depends in your .cabal file.
Looks like bytestring is hidden. Is it still possible to run ValidatorHash "f"
using any other means?
Edit #2
My question was initially specific to find out the origin of 66
when using the token in week01 code as ValidatorHash "f"
is taken from this statement in the contract myToken = KnownCurrency (ValidatorHash "f") "Token" (TokenName "T" :| [])
. But I was unable to evaluate it.