Closed Saizan closed 2 years ago
Currently aiken's Constant type handles only a subset of plutus-core's DefaultUni, in particular it's missing lists, pairs and "Data".
aiken
Constant
plutus-core
DefaultUni
data DefaultUni a where DefaultUniInteger :: DefaultUni (Esc Integer) DefaultUniByteString :: DefaultUni (Esc BS.ByteString) DefaultUniString :: DefaultUni (Esc Text.Text) DefaultUniUnit :: DefaultUni (Esc ()) DefaultUniBool :: DefaultUni (Esc Bool) DefaultUniProtoList :: DefaultUni (Esc []) DefaultUniProtoPair :: DefaultUni (Esc (,)) DefaultUniApply :: !(DefaultUni (Esc f)) -> !(DefaultUni (Esc a)) -> DefaultUni (Esc (f a)) DefaultUniData :: DefaultUni (Esc Data)
https://github.com/input-output-hk/plutus/blob/9ef6a65067893b4f9099215ff7947da00c5cd7ac/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs#L89-L98
e.g. trying to decode a script with a "Data" constant results in an Unknown constant constructor tag: 8 error, which matches the tag number used in plutus-core for "Data":
Unknown constant constructor tag: 8
8 -> k DefaultUniData
https://github.com/input-output-hk/plutus/blob/9ef6a65067893b4f9099215ff7947da00c5cd7ac/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs#L351
@Saizan thanks, this is on our radar already so we'll just use this as a tracking issue. Thank you for documenting this.
Currently
aiken
'sConstant
type handles only a subset ofplutus-core
'sDefaultUni
, in particular it's missing lists, pairs and "Data".https://github.com/input-output-hk/plutus/blob/9ef6a65067893b4f9099215ff7947da00c5cd7ac/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs#L89-L98
e.g. trying to decode a script with a "Data" constant results in an
Unknown constant constructor tag: 8
error, which matches the tag number used inplutus-core
for "Data":https://github.com/input-output-hk/plutus/blob/9ef6a65067893b4f9099215ff7947da00c5cd7ac/plutus-core/plutus-core/src/PlutusCore/Default/Universe.hs#L351