normalizeToil
    :: ProtocolMagic
    -> TxValidationRules
    -> TxpConfiguration
    -> BlockVersionData
    -> EpochIndex
    -> [(TxId, TxAux)]
    -> LocalToilM ()
normalizeToil pm txValRules txpConfig bvd curEpoch txs = mapM_ normalize ordered
  where
    -- If there is a cycle in the tx list, topsortTxs returns Nothing.
    -- Why is that not an error? And if its not an error, why bother
    -- top-sorting them anyway?
    ordered = fromMaybe txs $ topsortTxs wHash txs
    wHash (i, txAux) = WithHash (taTx txAux) i
    normalize ::
           (TxId, TxAux)
        -> LocalToilM ()
    normalize = void . runExceptT . processTx pm txValRules txpConfig bvd curEpoch

----------------------------------------------------------------------------
-- Verify and Apply logic
----------------------------------------------------------------------------

-- Note: it doesn't consider/affect stakes! That's because we don't
-- care about stakes for local txp.
normalizeToil
    :: ProtocolMagic
    -> TxValidationRules
    -> TxpConfiguration
    -> BlockVersionData
    -> EpochIndex
    -> [(TxId, TxAux)]
    -> LocalToilM ()
normalizeToil pm txValRules txpConfig bvd curEpoch txs = mapM_ normalize ordered
  where
    -- If there is a cycle in the tx list, topsortTxs returns Nothing.
    -- Why is that not an error? And if its not an error, why bother
    -- top-sorting them anyway?
    ordered = fromMaybe txs $ topsortTxs wHash txs
    wHash (i, txAux) = WithHash (taTx txAux) i
    normalize ::
           (TxId, TxAux)
        -> LocalToilM ()
    normalize = void . runExceptT . processTx pm txValRules txpConfig bvd curEpoch

----------------------------------------------------------------------------
-- Verify and Apply logic
----------------------------------------------------------------------------

-- Note: it doesn't consider/affect stakes! That's because we don't
-- care about stakes for local txp.
normalizeToil pm txValRules txpConfig bvd curEpoch txs = mapM_ normalize ordered
  where
    -- If there is a cycle in the tx list, topsortTxs returns Nothing.
    -- Why is that not an error? And if its not an error, why bother
    -- top-sorting them anyway?
    ordered = fromMaybe txs $ topsortTxs wHash txs
    wHash (i, txAux) = WithHash (taTx txAux) i
    normalize ::
           (TxId, TxAux)
        -> LocalToilM ()
    normalize = void . runExceptT . processTx pm txValRules txpConfig bvd curEpoch

----------------------------------------------------------------------------
-- Verify and Apply logic
----------------------------------------------------------------------------

-- Note: it doesn't consider/affect stakes! That's because we don't
-- care about stakes for local txp.