I created this datum with Mesh
const datumMD: Data = new Map<Data, Data>();
datumMD.set('name', assetName );
datumMD.set('question', input);
datumMD.set('answers', []);
datumMD.set('results', []);
const datumState: Data = new Map<Data, Data>();
datumState.set('state', 'INIT');
const datumMetadata: Data = {
alternative: 0,
fields: [datumMD, datumState]
};
The CBOR of that is:
d8799fa447616e737765727380446e616d654a70726f706f73616c2d33487175657374696f6e53446f657320697420776f726b3f20486d6d6d3f47726573756c747380a145737461746544494e4954ff
What would the type of that datum be in Plutus (Haskell)?
datumMD
you are using keys of type String but values of different types. In Haskell, Maps, just like lists, are homogenous, therefore you cannot have lists, then strings, then ... in the same map's values. I cannot help further, correct this and then we'll see how to translate your datum to a Haskell data type. Also, I'm interested in why you are doing it this way (Mesh -> Plutus) instead of the usual (Plutus -> Mesh)? Thanks in advance for the clarification :)