mlabs-haskell / purescript-cardano-types

Domain types for Cardano
6 stars 1 forks source link

Complete domain type definitions #2

Open klntsky opened 8 months ago

klntsky commented 8 months ago

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:

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:

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

See Cardano.Types.Internal.Helpers module for utilities that help defining instances, and see existing code for usage examples.

adamczykm commented 8 months ago

Picking this up :raised_hands:

adamczykm commented 8 months ago

A write access for my branch would be convenient :)