tweag / cooked-validators

MIT License
39 stars 11 forks source link

Split `MonadBlockChain`, abolish `MonadMockChain` #212

Closed carlhammann closed 1 year ago

carlhammann commented 1 year ago

The ideas of this PR are:

  1. Split MonadBlockChain into MonadBlockChainWithoutValidation, which contains everything but validateTxSkel, and the complete MonadBlockChain. The reasoning is that the former monad is a suitable domain for Tweaks to live in: Instead of expanding step-wise what Tweaks can do (#179 is the last PR in a long line of such PRs), let's just take the maximum, and allow Tweaks to do everything but transaction validation. @mmontin has been floating ideas like this at least since August, and PR #210 (which goes to this branch and should ideally be merged before this) tries it out.
  2. Make validateTxSkel chose the balancing wallet from among one of the signers of the TxSkel. By default, the balancing wallet is the first wallet in the nonempty list txSkelSigners, but there's an option to choose any other of these wallets. This allows us to throw away MonadMockChain and all of its "signer" terminology, which should reduce a lot of confusion, and close #180.

Before merging this PR, it might be useful to merge at least #210 and #207 (which target this branch).

Edit: #207 is merged.