tweag / cooked-validators

MIT License
39 stars 11 forks source link

Replace `datumFromTxOut` with `datumFromHash` #182

Closed carlhammann closed 1 year ago

carlhammann commented 1 year ago

This is related to some bigger-picture changes on PR #181, but I think it warrants its own discussion on a separate PR. The type of the function datumFromTxOut :: MonadBlockChain m => ChainIndexTxOut -> m (Maybe Datum), which currently is a primitive of MonadBlockChain, is a bit strange. Conceptually, I think that two functions, namely

would be a cleaner solution. In particular, this would free us to do whatever we want to the SpendableOut type, as long as we remain able to query it for datum hashes.