tweag / cooked-validators

MIT License
39 stars 11 forks source link

Improve naming of redeemers smart constructors in skeleton #438

Closed florentc closed 2 months ago

florentc commented 4 months ago

Very tiny nitpicking issue.

For now, there is txSkelSomeRedeemer and txSkelEmptyRedeemer to pass redeemers to scripts in skeletons. There is also txSkelRedeemer which is a field accessor in skeletons (actually TxSkelRedeemer but the spirit is the same).

This is a bit confusing when using the user facing API. Completion pops up txSkelRedeemer easily instead of txSkelSomeRedeemer. Besides, the txSkel prefix should be used for field accessors only out of consistency.

I would advocate for dropping txSkel and renaming those to someRedeemer and emptyRedeemer. We could even just have redeemer and use () when empty (although we would lose a bit of abstraction).