user7627: 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?

user1071: ff is not a valid PolicyId (aka CurrencySymbol). It must be 28 bytes.
For examples, see this answer on this similar Github issue https://github.com/input-output-hk/plutus-apps/issues/732#issuecomment-1265261105

7627: <p>I try to set an initial state of the emulator like so:</p>
<pre><code>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
</code></pre>
<p>It works perfectly. However when I set a custom currency <code>ff</code> with:</p>
<pre><code>    dist = Map.fromList [ (senderWallet, Ada.lovelaceValueOf 100_000_000
                           &lt;&gt; Value.singleton &quot;ff&quot; &quot;TokenName&quot; 100_000_000)
                        , (receiverWallet, Ada.lovelaceValueOf 100_000_000)
                        ]
</code></pre>
<p>The script compiles but after running <code>test</code> I get this error:</p>
<blockquote>
<p>*** Exception: Cannot build the initial state: Tag &quot;toCardanoPolicyId&quot; (Tag &quot;1 bytes&quot; DeserialisationError) CallStack (from HasCallStack):<br />
error, called at src/Wallet/Emulator/Stream.hs:171:12 in
plutus-contract-1.0.0.0-68585fe6251fbab3f7ee7ae8755133e693587e4f6afa588ae8db3b056e79dcc0:Wallet.Emulator.Stream</p>
</blockquote>
<p>This is plutus-apps v.1.0.0. This code works with some other tags.</p>
<p>How do I fix this? Is this a bug?</p>
 1071: <p><code>ff</code> is not a valid PolicyId (aka CurrencySymbol). It must be 28 bytes.</p>
<p>For examples, see this answer on this similar Github issue <a href="https://github.com/input-output-hk/plutus-apps/issues/732#issuecomment-1265261105" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus-apps/issues/732#issuecomment-1265261105</a></p>
