Open klntsky opened 2 weeks ago
The methods for Mint are:
Mint
insert(key: ScriptHash, value: MintAssets): MintAssets | void; get(key: ScriptHash): MintsAssets | void;
MintAssets value is being inserted, but get returns MintsAssets. This breaks our codegen assumption for map-like types, that thinks that the exact same type that was put in can be extracted.
MintAssets
get
MintsAssets
We work around this downstream in a very hacky way: https://github.com/mlabs-haskell/purescript-cardano-types/blob/8f9e5d0e0a465990024fac7c8e8db36fcd56ab8c/src/Cardano/Types/Mint.purs#L176
UPD: refactored the hack to make it more obvious
https://github.com/mlabs-haskell/purescript-cardano-types/blob/b084f05e1cc8c4e99fce2c42cf988590555c0ca7/src/Cardano/Types/Mint.purs#L136
The methods for
Mint
are:MintAssets
value is being inserted, butget
returnsMintsAssets
. This breaks our codegen assumption for map-like types, that thinks that the exact same type that was put in can be extracted.We work around this downstream in a very hacky way: https://github.com/mlabs-haskell/purescript-cardano-types/blob/8f9e5d0e0a465990024fac7c8e8db36fcd56ab8c/src/Cardano/Types/Mint.purs#L176