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
The problem
We sometimes accidentally generate TxSkels that are invalid for reasons like missing inputs, negative Ada amounts, etc. (At least I hope I'm not the only one prone to such mistakes.) Yesterday, I spent more than an hour debugging because of a negative Ada amount that sent the validation into a loop, somehow.
Possible solution/Question
I'd like to have a function isSane :: SanityOptions -> TxSkel -> Bool, maybe also a function sanitize :: SanityOptions -> TxSkel -> TxSkel, for some suitable type SanityOptions, that I can call on my TxSkel and figure out if and how it is broken before handing it to validation.
If something like that already exists, it's at least hidden enough that I've not yet found it.
The text was updated successfully, but these errors were encountered:
I'm generally against adding a function sanitize because when we try to validate a transaction we will already get a number of errors indicating what's wrong with it.
I do agree that the amount of processing that happens under the hood with transaction processing is too much and can cause confusion.
The problem
We sometimes accidentally generate
TxSkel
s that are invalid for reasons like missing inputs, negative Ada amounts, etc. (At least I hope I'm not the only one prone to such mistakes.) Yesterday, I spent more than an hour debugging because of a negative Ada amount that sent the validation into a loop, somehow.Possible solution/Question
I'd like to have a function
isSane :: SanityOptions -> TxSkel -> Bool
, maybe also a functionsanitize :: SanityOptions -> TxSkel -> TxSkel
, for some suitable typeSanityOptions
, that I can call on myTxSkel
and figure out if and how it is broken before handing it to validation.If something like that already exists, it's at least hidden enough that I've not yet found it.
The text was updated successfully, but these errors were encountered: