tweag / cooked-validators

MIT License
39 stars 11 forks source link

Replace the nonempty list of signers with a regular list #268

Closed carlhammann closed 1 year ago

carlhammann commented 1 year ago

This PR changes the type of txSkelSigners to a regular list of wallets instead of a nonempty list. This arguably makes the type TxSkel less "safe", in the sense that there's now another way to write invalid transactions (by forgetting to add signers), but we gain a clearer txSkelTemplate, which doesn't any more contain a "hidden default" wallet 1 signer.

We initially thought that we could have both the type safety of nonempty lists and the convenience and clarity of vanilla lists by using OverloadedLists, but we recently learned that this laguage extension affords no compile-time checks. But then, if an empty list of signers will lead to a run time error anyway, we can just throw it ourselves in the two places that make sense.