I try to set an initial state of the emulator like so:
test :: IO ()
test = runEmulatorTraceIO' def emCfg myTrace
where
dist = Map.fromList [ (senderWallet, Ada.lovelaceValueOf 100_000_000)
, (receiverWallet, Ada.lovelaceValueOf 100_000_000)
]
emCfg :: EmulatorConfig
emCfg = EmulatorConfig (Left dist) def
myTrace :: EmulatorTrace ()
myTrace = do
void $ Emulator.payToWallet (senderWallet) (receiverWallet) $ Ada.lovelaceValueOf 5_000_000
void $ Emulator.waitNSlots 1
It works perfectly. However when I set a custom currency ff
with:
dist = Map.fromList [ (senderWallet, Ada.lovelaceValueOf 100_000_000
<> Value.singleton "ff" "TokenName" 100_000_000)
, (receiverWallet, Ada.lovelaceValueOf 100_000_000)
]
The script compiles but after running test
I get this error:
*** Exception: Cannot build the initial state: Tag "toCardanoPolicyId" (Tag "1 bytes" DeserialisationError) CallStack (from HasCallStack):
error, called at src/Wallet/Emulator/Stream.hs:171:12 in plutus-contract-1.0.0.0-68585fe6251fbab3f7ee7ae8755133e693587e4f6afa588ae8db3b056e79dcc0:Wallet.Emulator.Stream
This is plutus-apps v.1.0.0. This code works with some other tags.
How do I fix this? Is this a bug?