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
one pure function to look for datum (hashes) in ChainIndexTxOuts, and
one function in MonadBlockChain to resolve datum hashes
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.
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 ofMonadBlockChain
, is a bit strange. Conceptually, I think that two functions, namelyChainIndexTxOut
s, andMonadBlockChain
to resolve datum hasheswould 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.