Skip to content

Commit 89109c0

Browse files
committed
[wip] update ledger event patterns
1 parent 72fee0d commit 89109c0

File tree

1 file changed

+16
-13
lines changed
  • cardano-api/src/Cardano/Api/LedgerState/Internal/Rule/BBODY

1 file changed

+16
-13
lines changed

cardano-api/src/Cardano/Api/LedgerState/Internal/Rule/BBODY/UTXOW.hs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE DataKinds #-}
22
{-# LANGUAGE FlexibleContexts #-}
3+
{-# LANGUAGE LambdaCase #-}
34
{-# LANGUAGE TypeFamilies #-}
45
{-# LANGUAGE TypeOperators #-}
56

@@ -29,24 +30,26 @@ import Control.State.Transition.Extended
2930

3031
handleConwayUTxOWEvent
3132
:: AlonzoUtxowEvent ConwayEra -> Maybe LedgerEvent
32-
handleConwayUTxOWEvent (Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent (Alonzo.UtxosEvent conwayUTxOsEvent))) =
33-
case conwayUTxOsEvent of
34-
Conway.TotalDeposits{} -> Nothing
35-
Conway.SuccessfulPlutusScriptsEvent e -> Just $ SuccessfulPlutusScript e
36-
Conway.FailedPlutusScriptsEvent e -> Just $ FailedPlutusScript e
37-
Conway.TxUTxODiff _ _ -> Nothing
33+
handleConwayUTxOWEvent = \case
34+
(Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent TotalDeposits{})) -> Nothing
35+
(Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent TxUTxODiff{})) -> Nothing
36+
(Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent (Alonzo.UtxosEvent conwayUTxOsEvent))) ->
37+
case conwayUTxOsEvent of
38+
Conway.SuccessfulPlutusScriptsEvent e -> Just $ SuccessfulPlutusScript e
39+
Conway.FailedPlutusScriptsEvent e -> Just $ FailedPlutusScript e
3840

3941
handleAlonzoUTxOWEvent
4042
:: Event (Ledger.Core.EraRule "UTXO" ledgerera) ~ AlonzoUtxoEvent ledgerera
4143
=> Event (Ledger.Core.EraRule "UTXOS" ledgerera) ~ AlonzoUtxosEvent ledgerera
4244
=> AlonzoUtxowEvent ledgerera -> Maybe LedgerEvent
43-
handleAlonzoUTxOWEvent (WrappedShelleyEraEvent (Shelley.UtxoEvent (UtxosEvent utxoEvent))) =
44-
case utxoEvent of
45-
Alonzo.AlonzoPpupToUtxosEvent{} -> Nothing
46-
Alonzo.TotalDeposits{} -> Nothing
47-
Alonzo.SuccessfulPlutusScriptsEvent e -> Just $ SuccessfulPlutusScript e
48-
Alonzo.FailedPlutusScriptsEvent e -> Just $ FailedPlutusScript e
49-
Alonzo.TxUTxODiff _ _ -> Nothing
45+
handleAlonzoUTxOWEvent = \case
46+
(Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent TotalDeposits{})) -> Nothing
47+
(Alonzo.WrappedShelleyEraEvent (Shelley.UtxoEvent TxUTxODiff{})) -> Nothing
48+
(WrappedShelleyEraEvent (Shelley.UtxoEvent (UtxosEvent utxoEvent))) ->
49+
case utxoEvent of
50+
Alonzo.AlonzoPpupToUtxosEvent{} -> Nothing
51+
Alonzo.SuccessfulPlutusScriptsEvent e -> Just $ SuccessfulPlutusScript e
52+
Alonzo.FailedPlutusScriptsEvent e -> Just $ FailedPlutusScript e
5053

5154
handlePreAlonzoUTxOWEvent
5255
:: Event (Ledger.Core.EraRule "UTXO" ledgerera) ~ Shelley.UtxoEvent ledgerera

0 commit comments

Comments
 (0)