mlabs-haskell / clb

Cardano Node Emulator (next-gen PSM)
7 stars 3 forks source link

Put real Ledger errors into `CardanoLedgerValidationError` #20

Closed uhbif19 closed 5 months ago

uhbif19 commented 6 months ago

Now CardanoLedgerValidationError contains text. Moreover rest of ValidationError datatype is not used at all.

But seems like one could import those errors from modules like Cardano.Ledger.Shelley.Rules and return it to user. Thus they can be handled, like it is needed for PSM.

There errors seem to cover all errors we need, like OutsideValidityIntervalUTxO showing current slot is too far away.

Probably we need to document and re-export errors which may be obtainable by user like: BadInputsUTxO, FeeTooSmallUTxO, TxBodyEmptyTxIns, ValueNotConservedUTxO.

CC @euonymos

euonymos commented 6 months ago

You are quite right, that's what we need to do, Text errors were implemented in a makeshift manner, and we definitely want to revise them.