You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the CTL codebase we made a (bad?) decision to mix plutus and cardano types together for those types that are literally the same (Ctl.Internal.Types). This effort is our attempt to clean up this mess and provide reusable datatype definitions.
purescript-cardano-types (PCT) is a wrapper over PS-CSL types, that is designed as follows:
for simple types, like ScriptHash, we simply newtype the corresponding PS-CSL type to provide instances
for complex ADTs, like PlutusData, we define them as PureScript ADTs and define toCsl / fromCsl functions that cover all the cases.
Note that, in the existing code we also provide ToData/FromData instances. This was not actually needed. Please do not include them anymore and remove the existing ToData/FromData machinery (it should be in plutus domain)
The ask
Complete this library by adapting all cardano-domain types we have in CSL.
klntsky/generate-for-ctl branch must be used. PS-CSL is autogenerated, see the codegen in that repo. This codegen code relies on manual specifications of some things, like ability of functions to throw in some cases. It may be that the generated code is subtly wrong. In that case, replace toCsl/fromCsl with notImplemented and move on - I'll handle the remaining cases when I'm back.
Follow existing cardano-domain definitions in CTL (type definitions and instances should be copy-pasteable for most of the types).
For every type, we need the following
derive instance Generic
Eq instance
Ord instance
EncodeAeson instance (should be compatible with CTL if there is one there)
DecodeAeson instance (should be compatible with CTL if there is one there)
Show - using genericShow
AsCbor
fromCsl function, if a data type is not a plain newtype over CSL type
toCsl function, if a data type is not a plain newtype over CSL type
See Cardano.Types.Internal.Helpers module for utilities that help defining instances, and see existing code for usage examples.
The text was updated successfully, but these errors were encountered:
Context
We need to add all Cardano Domain data types used by CTL to this library. In CTL (current
develop
), there are 3 conceptual domains:foreign import data
)cardano-api
) (Ctl.Internal.Cardano.Types
)plutus-ledger-api
) (Ctl.Internal.Plutus.Types
)In the CTL codebase we made a (bad?) decision to mix plutus and cardano types together for those types that are literally the same (
Ctl.Internal.Types
). This effort is our attempt to clean up this mess and provide reusable datatype definitions.purescript-cardano-types
(PCT) is a wrapper over PS-CSL types, that is designed as follows:ScriptHash
, we simply newtype the corresponding PS-CSL type to provide instancesPlutusData
, we define them as PureScript ADTs and definetoCsl
/fromCsl
functions that cover all the cases.Note that, in the existing code we also provide
ToData
/FromData
instances. This was not actually needed. Please do not include them anymore and remove the existingToData
/FromData
machinery (it should be in plutus domain)The ask
Complete this library by adapting all cardano-domain types we have in CSL.
klntsky/generate-for-ctl
branch must be used. PS-CSL is autogenerated, see the codegen in that repo. This codegen code relies on manual specifications of some things, like ability of functions to throw in some cases. It may be that the generated code is subtly wrong. In that case, replacetoCsl
/fromCsl
withnotImplemented
and move on - I'll handle the remaining cases when I'm back.Follow existing cardano-domain definitions in CTL (type definitions and instances should be copy-pasteable for most of the types).
For every type, we need the following
derive instance Generic
genericShow
fromCsl
function, if a data type is not a plain newtype over CSL typetoCsl
function, if a data type is not a plain newtype over CSL typeSee
Cardano.Types.Internal.Helpers
module for utilities that help defining instances, and see existing code for usage examples.The text was updated successfully, but these errors were encountered: