diff --git a/alonzo/test/test/Test/Cardano/Ledger/Alonzo/Trials.hs b/alonzo/test/test/Test/Cardano/Ledger/Alonzo/Trials.hs index b8c1108f58..409f4e32f1 100644 --- a/alonzo/test/test/Test/Cardano/Ledger/Alonzo/Trials.hs +++ b/alonzo/test/test/Test/Cardano/Ledger/Alonzo/Trials.hs @@ -81,8 +81,8 @@ import Shelley.Spec.Ledger.LedgerState UTxOState, ) import Shelley.Spec.Ledger.PParams (PParams' (..)) -import Shelley.Spec.Ledger.STS.Chain (CHAIN, ChainPredicateFailure (..), ChainState (..), Event (..)) -import Shelley.Spec.Ledger.STS.Ledger (Event (..), LEDGER, LedgerEnv (..), LedgerPredicateFailure (UtxowFailure)) +import Shelley.Spec.Ledger.STS.Chain (CHAIN, ChainPredicateFailure (..), ChainState (..)) +import Shelley.Spec.Ledger.STS.Ledger (LEDGER, LedgerEnv (..), LedgerPredicateFailure (UtxowFailure)) import System.Timeout import Test.Cardano.Ledger.Alonzo.AlonzoEraGen () import Test.Cardano.Ledger.EraBuffet (TestCrypto) @@ -118,11 +118,9 @@ import Test.Tasty.QuickCheck instance Embed (AlonzoBBODY (AlonzoEra TestCrypto)) (CHAIN (AlonzoEra TestCrypto)) where wrapFailed = BbodyFailure - wrapEvent = BbodyEvent instance Embed (AlonzoUTXOW (AlonzoEra TestCrypto)) (LEDGER (AlonzoEra TestCrypto)) where wrapFailed = UtxowFailure - wrapEvent = UtxowEvent -- ====================================================================================== -- It is incredably hard to debug property test generators. These functions mimic the diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/BBody.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/BBody.hs index 4378e016e1..5c437e143e 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/BBody.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/BBody.hs @@ -22,7 +22,7 @@ import Byron.Spec.Ledger.Update (PParams, UPIState, maxBkSz) import Byron.Spec.Ledger.UTxO (UTxO) import Control.State.Transition (Embed, Environment, STS (..), Signal, State, TRC (TRC), initialRules, judgmentContext, trans, transitionRules, wrapFailed, - (?!), wrapEvent) + (?!)) import Byron.Spec.Chain.STS.Block @@ -57,11 +57,6 @@ instance STS BBODY where type PredicateFailure BBODY = BbodyPredicateFailure - data Event _ - = BUPIEvent (Event BUPI) - | DelegationEvent (Event DELEG) - | UTXOWSEvent (Event UTXOWS) - initialRules = [] transitionRules = @@ -98,12 +93,9 @@ instance STS BBODY where instance Embed BUPI BBODY where wrapFailed = BUPIFailure - wrapEvent = BUPIEvent instance Embed DELEG BBODY where wrapFailed = DelegationFailure - wrapEvent = DelegationEvent instance Embed UTXOWS BBODY where wrapFailed = UTXOWSFailure - wrapEvent = UTXOWSEvent diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Bupi.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Bupi.hs index 79a09f8856..e704796632 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Bupi.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Bupi.hs @@ -9,8 +9,8 @@ import Data.Data (Data, Typeable) import Control.State.Transition (Embed, Environment, PredicateFailure, STS, Signal, State, - TRC (TRC), TransitionRule, Event, initialRules, judgmentContext, trans, - transitionRules, wrapFailed, wrapEvent) + TRC (TRC), TransitionRule, initialRules, judgmentContext, trans, + transitionRules, wrapFailed) import Byron.Spec.Ledger.Core (VKey) import Byron.Spec.Ledger.Update (ProtVer, UPIEND, UPIEnv, UPIREG, UPIState, UPIVOTES, UProp, Vote) @@ -39,11 +39,6 @@ instance STS BUPI where type PredicateFailure BUPI = BupiPredicateFailure - data Event _ - = UPIREGEvent (Event UPIREG) - | UPVOTESEvent (Event UPIVOTES) - | UPIENDEvent (Event UPIEND) - initialRules = [] transitionRules = @@ -72,12 +67,9 @@ instance STS BUPI where instance Embed UPIREG BUPI where wrapFailed = UPIREGFailure - wrapEvent = UPIREGEvent instance Embed UPIVOTES BUPI where wrapFailed = UPIVOTESFailure - wrapEvent = UPVOTESEvent instance Embed UPIEND BUPI where wrapFailed = UPIENDFailure - wrapEvent = UPIENDEvent diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Chain.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Chain.hs index 7aa5f3df3c..b7b3ad52ec 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Chain.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Chain.hs @@ -87,16 +87,6 @@ instance STS CHAIN where type PredicateFailure CHAIN = ChainPredicateFailure - data Event _ - = UPIREGEvent ( Event UPIREG ) - | UPVOTESEvent ( Event UPIVOTES ) - | UPIENDEvent ( Event UPIEND ) - | EpochEvent ( Event EPOCH ) - | BBodyEvent ( Event BBODY ) - | PBFTEvent ( Event PBFT ) - | LedgerDelegationEvent ( Event DELEG ) - | LedgerUTxOEvent ( Event UTXOWS ) - initialRules = [ do IRC (_sNow, utxo0', ads, pps', k) <- judgmentContext @@ -172,23 +162,18 @@ instance STS CHAIN where instance Embed EPOCH CHAIN where wrapFailed = EpochFailure - wrapEvent = EpochEvent instance Embed BBODY CHAIN where wrapFailed = BBodyFailure - wrapEvent = BBodyEvent instance Embed PBFT CHAIN where wrapFailed = PBFTFailure - wrapEvent = PBFTEvent instance Embed DELEG CHAIN where wrapFailed = LedgerDelegationFailure - wrapEvent = LedgerDelegationEvent instance Embed UTXOWS CHAIN where wrapFailed = LedgerUTxOFailure - wrapEvent = LedgerUTxOEvent isHeaderSizeTooBigFailure :: PredicateFailure CHAIN -> Bool isHeaderSizeTooBigFailure (HeaderSizeTooBig _ _ _) = True diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Epoch.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Epoch.hs index 83a1e9676c..7f08ae732f 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Epoch.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Epoch.hs @@ -42,8 +42,6 @@ instance STS EPOCH where type Signal EPOCH = Slot type PredicateFailure EPOCH = EpochPredicateFailure - data Event _ = UPIECEvent (Event UPIEC) - initialRules = [] transitionRules = @@ -59,4 +57,3 @@ instance STS EPOCH where instance Embed UPIEC EPOCH where wrapFailed = UPIECFailure - wrapEvent = UPIECEvent diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Pbft.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Pbft.hs index 1ad560d5cd..fcd43800f9 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Pbft.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/Pbft.hs @@ -43,8 +43,6 @@ instance STS PBFT where type PredicateFailure PBFT = PbftPredicateFailure - data Event _ = SigCountEvent (Event SIGCNT) - initialRules = [] transitionRules = @@ -63,4 +61,3 @@ instance STS PBFT where instance Embed SIGCNT PBFT where wrapFailed = SigCountFailure - wrapEvent = SigCountEvent diff --git a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/SigCnt.hs b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/SigCnt.hs index b3630d2505..a042a32707 100644 --- a/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/SigCnt.hs +++ b/byron/chain/executable-spec/src/Byron/Spec/Chain/STS/Rule/SigCnt.hs @@ -44,8 +44,6 @@ instance STS SIGCNT where type Signal SIGCNT = VKey type PredicateFailure SIGCNT = SigcntPredicateFailure - data Event _ - initialRules = [] transitionRules = diff --git a/byron/crypto/test/Test/Cardano/Crypto/Limits.hs b/byron/crypto/test/Test/Cardano/Crypto/Limits.hs index e02d14b4c1..9fdf3d556a 100644 --- a/byron/crypto/test/Test/Cardano/Crypto/Limits.hs +++ b/byron/crypto/test/Test/Cardano/Crypto/Limits.hs @@ -45,7 +45,7 @@ tests = checkParallel $$discover -- is almost certainly amiss. newtype Limit t = Limit - { getLimit :: Word32 + { getLimit :: Word32 } deriving (Eq, Ord, Show, Num, Enum, Real, Integral) instance Functor Limit where diff --git a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Delegation.hs b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Delegation.hs index 0053859c44..4d972895d2 100644 --- a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Delegation.hs +++ b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Delegation.hs @@ -114,7 +114,7 @@ import Lens.Micro (Lens', lens, to, (%~), (&), (.~), (<>~), (^.), _1) import Lens.Micro.TH (makeFields) import NoThunks.Class (NoThunks (..), allNoThunks, noThunksInKeysAndValues) -import Control.State.Transition (Embed(..), Environment, IRC (IRC), PredicateFailure, STS(..), +import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS, Signal, State, TRC (TRC), initialRules, judgmentContext, trans, transitionRules, wrapFailed, (?!)) import Control.State.Transition.Generator (HasTrace, SignalGenerator, envGen, genTrace, @@ -301,7 +301,6 @@ instance STS SDELEG where type Signal SDELEG = DCert type Environment SDELEG = DSEnv type PredicateFailure SDELEG = SdelegPredicateFailure - data Event _ initialRules = [ return DSState { _dSStateScheduledDelegations = [] @@ -375,7 +374,6 @@ instance STS ADELEG where type Signal ADELEG = (Slot, (VKeyGenesis, VKey)) type Environment ADELEG = Set VKeyGenesis type PredicateFailure ADELEG = AdelegPredicateFailure - data Event _ initialRules = [ @@ -435,7 +433,6 @@ instance STS SDELEGS where type Signal SDELEGS = [DCert] type Environment SDELEGS = DSEnv type PredicateFailure SDELEGS = SdelegsPredicateFailure - data Event _ = SDelegEvent (Event SDELEG) initialRules = [ do IRC env <- judgmentContext @@ -454,7 +451,6 @@ instance STS SDELEGS where instance Embed SDELEG SDELEGS where wrapFailed = SDelegFailure - wrapEvent = SDelegEvent -- | Delegation rules sequencing data ADELEGS deriving (Data, Typeable) @@ -467,7 +463,6 @@ instance STS ADELEGS where type State ADELEGS = DState type Signal ADELEGS = [(Slot, (VKeyGenesis, VKey))] type Environment ADELEGS = Set VKeyGenesis - data Event _ = ADelegEvent (Event ADELEG) type PredicateFailure ADELEGS = AdelegsPredicateFailure @@ -489,7 +484,6 @@ instance STS ADELEGS where instance Embed ADELEG ADELEGS where wrapFailed = ADelegFailure - wrapEvent = ADelegEvent -- | Delegation interface data DELEG deriving (Data, Typeable) @@ -505,9 +499,6 @@ instance STS DELEG where type Environment DELEG = DIEnv type PredicateFailure DELEG = DelegPredicateFailure - data Event _ - = SDelegSEvent (Event SDELEGS) - | ADelegSEvent (Event ADELEGS) initialRules = [ do IRC env <- judgmentContext @@ -537,11 +528,9 @@ instance STS DELEG where instance Embed SDELEGS DELEG where wrapFailed = SDelegSFailure - wrapEvent = SDelegSEvent instance Embed ADELEGS DELEG where wrapFailed = ADelegSFailure - wrapEvent = ADelegSEvent -------------------------------------------------------------------------------- -- Generators @@ -621,7 +610,6 @@ instance STS MSDELEG where type State MSDELEG = DSState type Signal MSDELEG = Maybe DCert type PredicateFailure MSDELEG = MsdelegPredicateFailure - data Event _ = SDELEGEvent (Event SDELEG) initialRules = [] @@ -635,7 +623,6 @@ instance STS MSDELEG where instance Embed SDELEG MSDELEG where wrapFailed = SDELEGFailure - wrapEvent = SDELEGEvent instance HasTrace MSDELEG where diff --git a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXO.hs b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXO.hs index fdab458960..d626f5b01d 100644 --- a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXO.hs +++ b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXO.hs @@ -27,7 +27,7 @@ import Data.Data (Data, Typeable) import qualified Data.Set as Set import GHC.Generics (Generic) -import Control.State.Transition (Environment, IRC (IRC), PredicateFailure, STS, Event, Signal, +import Control.State.Transition (Environment, IRC (IRC), PredicateFailure, STS, Signal, State, TRC (TRC), initialRules, judgmentContext, transitionRules, (?!)) import Byron.Spec.Ledger.Core (Lovelace, dom, range, (∪), (⊆), (⋪), (◁)) import Byron.Spec.Ledger.GlobalParams (lovelaceCap) @@ -70,7 +70,6 @@ instance STS UTXO where type State UTXO = UTxOState type Signal UTXO = Tx type PredicateFailure UTXO = UtxoPredicateFailure - data Event _ initialRules = [ do diff --git a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOW.hs b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOW.hs index a2418e52d6..439081c645 100644 --- a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOW.hs +++ b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOW.hs @@ -25,7 +25,7 @@ import qualified Hedgehog.Gen as Gen import Hedgehog.Internal.Property (CoverPercentage) import qualified Hedgehog.Range as Range -import Control.State.Transition (Embed(..), Environment, IRC (IRC), STS (..), +import Control.State.Transition (Embed, Environment, IRC (IRC), STS (..), Signal, State, TRC (TRC), initialRules, judgmentContext, trans, transitionRules, wrapFailed, (?!)) import Control.State.Transition.Generator (HasTrace, SignalGenerator, coverFailures, @@ -58,7 +58,6 @@ instance STS UTXOW where type State UTXOW = UTxOState type Signal UTXOW = Tx type PredicateFailure UTXOW = UtxowPredicateFailure - data Event _ = UtxoEvent (Event UTXO) initialRules = [ do @@ -94,7 +93,6 @@ witnessed (Tx tx wits) utxo = instance Embed UTXO UTXOW where wrapFailed = UtxoFailure - wrapEvent = UtxoEvent -- | Constant list of addresses intended to be used in the generators. traceAddrs :: [Addr] diff --git a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOWS.hs b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOWS.hs index c14c5ba4fa..c87834773b 100644 --- a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOWS.hs +++ b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/STS/UTXOWS.hs @@ -20,9 +20,9 @@ import GHC.Generics (Generic) import Byron.Spec.Ledger.STS.UTXO (UTxOEnv, UTxOState) import Byron.Spec.Ledger.STS.UTXOW (UTXOW) import Byron.Spec.Ledger.UTxO (Tx) -import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS(..), +import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS, Signal, State, TRC (TRC), initialRules, judgmentContext, trans, - transitionRules, wrapFailed, wrapEvent) + transitionRules, wrapFailed) import Control.State.Transition.Generator (HasTrace, envGen, genTrace, sigGen) import Control.State.Transition.Trace (TraceOrder (OldestFirst), traceSignals) @@ -37,7 +37,6 @@ instance STS UTXOWS where type Signal UTXOWS = [Tx] type Environment UTXOWS = UTxOEnv type PredicateFailure UTXOWS = UtxowsPredicateFailure - data Event _ = UtxowEvent (Event UTXOW) initialRules = [ do @@ -58,7 +57,6 @@ instance STS UTXOWS where instance Embed UTXOW UTXOWS where wrapFailed = UtxowFailure - wrapEvent = UtxowEvent instance HasTrace UTXOWS where envGen = envGen @UTXOW diff --git a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Update.hs b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Update.hs index d4c7fb36e4..1c22a5421a 100644 --- a/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Update.hs +++ b/byron/ledger/executable-spec/src/Byron/Spec/Ledger/Update.hs @@ -385,7 +385,6 @@ instance STS UPSVV where type State UPSVV = Map UpId (ApName, ApVer, Metadata) type Signal UPSVV = UProp type PredicateFailure UPSVV = UpsvvPredicateFailure - data Event _ initialRules = [] transitionRules = @@ -424,7 +423,6 @@ instance STS UPPVV where type State UPPVV = Map UpId (ProtVer, PParams) type Signal UPPVV = UProp type PredicateFailure UPPVV = UppvvPredicateFailure - data Event _ initialRules = [] transitionRules = @@ -467,9 +465,6 @@ instance STS UPV where type Signal UPV = UProp type PredicateFailure UPV = UpvPredicateFailure - data Event _ - = UPPVVEvent (Event UPPVV) - | UPSVVEvent (Event UPSVV) initialRules = [] transitionRules = @@ -505,11 +500,9 @@ instance STS UPV where instance Embed UPPVV UPV where wrapFailed = UPPVVFailure - wrapEvent = UPPVVEvent instance Embed UPSVV UPV where wrapFailed = UPSVVFailure - wrapEvent = UPSVVEvent data UPREG deriving (Generic, Data, Typeable) -- | These `PredicateFailure`s are all throwable. @@ -532,8 +525,6 @@ instance STS UPREG where ) type Signal UPREG = UProp type PredicateFailure UPREG = UpregPredicateFailure - data Event _ - = UPVEvent (Event UPV) initialRules = [] transitionRules = @@ -553,7 +544,6 @@ instance STS UPREG where instance Embed UPV UPREG where wrapFailed = UPVFailure - wrapEvent = UPVEvent ------------------------------------------------------------------------ -- Update voting @@ -602,7 +592,6 @@ instance STS ADDVOTE where type State ADDVOTE = Set (UpId, Core.VKeyGenesis) type Signal ADDVOTE = Vote type PredicateFailure ADDVOTE = AddvotePredicateFailure - data Event _ initialRules = [] transitionRules = @@ -649,7 +638,6 @@ instance STS UPVOTE where ) type Signal UPVOTE = Vote type PredicateFailure UPVOTE = UpvotePredicateFailure - data Event _ = ADDVOTEEvent (Event ADDVOTE) initialRules = [] transitionRules = @@ -681,7 +669,6 @@ instance STS UPVOTE where instance Embed ADDVOTE UPVOTE where wrapFailed = ADDVOTEFailure - wrapEvent = ADDVOTEEvent ------------------------------------------------------------------------ -- Update voting @@ -697,7 +684,6 @@ instance STS FADS where type State FADS = [(Core.Slot, (ProtVer, PParams))] type Signal FADS = (Core.Slot, (ProtVer, PParams)) type PredicateFailure FADS = FadsPredicateFailure - data Event _ initialRules = [] transitionRules = @@ -753,7 +739,6 @@ instance STS UPEND where ) type Signal UPEND = (ProtVer, Core.VKey) type PredicateFailure UPEND = UpendPredicateFailure - data Event _ = FADSEvent (Event FADS) initialRules = [] transitionRules = @@ -825,7 +810,6 @@ instance STS UPEND where instance Embed FADS UPEND where wrapFailed = error "No possible failures in FADS" - wrapEvent = FADSEvent ------------------------------------------------------------------------ -- Update interface @@ -964,7 +948,6 @@ instance STS UPIREG where type State UPIREG = UPIState type Signal UPIREG = UProp type PredicateFailure UPIREG = UpiregPredicateFailure - data Event _ = UPREGEvent (Event UPREG) initialRules = [ return $! emptyUPIState ] @@ -998,7 +981,6 @@ instance STS UPIREG where instance Embed UPREG UPIREG where wrapFailed = UPREGFailure - wrapEvent = UPREGEvent instance HasTrace UPIREG where @@ -1342,7 +1324,6 @@ instance STS UPIVOTE where type State UPIVOTE = UPIState type Signal UPIVOTE = Vote type PredicateFailure UPIVOTE = UpivotePredicateFailure - data Event _ = UPVOTEEvent (Event UPVOTE) initialRules = [] transitionRules = @@ -1383,7 +1364,6 @@ instance STS UPIVOTE where instance Embed UPVOTE UPIVOTE where wrapFailed = UPVOTEFailure - wrapEvent = UPVOTEEvent data APPLYVOTES deriving (Generic, Data, Typeable) @@ -1397,7 +1377,6 @@ instance STS APPLYVOTES where type State APPLYVOTES = UPIState type Signal APPLYVOTES = [Vote] type PredicateFailure APPLYVOTES = ApplyVotesPredicateFailure - data Event _ = UpivoteEvent (Event UPIVOTE) initialRules = [ return $! emptyUPIState ] @@ -1414,7 +1393,6 @@ instance STS APPLYVOTES where instance Embed UPIVOTE APPLYVOTES where wrapFailed = UpivoteFailure - wrapEvent = UpivoteEvent data UPIVOTES deriving (Generic, Data, Typeable) @@ -1427,7 +1405,6 @@ instance STS UPIVOTES where type State UPIVOTES = UPIState type Signal UPIVOTES = [Vote] type PredicateFailure UPIVOTES = UpivotesPredicateFailure - data Event _ = ApplyVotesEvent (Event APPLYVOTES) initialRules = [ return $! emptyUPIState ] @@ -1474,7 +1451,6 @@ instance STS UPIVOTES where instance Embed APPLYVOTES UPIVOTES where wrapFailed = ApplyVotesFailure - wrapEvent = ApplyVotesEvent instance HasTrace UPIVOTES where @@ -1575,7 +1551,6 @@ instance STS UPIEND where type State UPIEND = UPIState type Signal UPIEND = (ProtVer, Core.VKey) type PredicateFailure UPIEND = UpiendPredicateFailure - data Event _ = UPENDEvent (Event UPEND) initialRules = [ return $! emptyUPIState ] @@ -1615,7 +1590,6 @@ instance STS UPIEND where instance Embed UPEND UPIEND where wrapFailed = UPENDFailure - wrapEvent = UPENDEvent -- | Given a list of protocol versions and keys endorsing those versions, -- generate a protocol-version endorsement, or 'Nothing' if the list of @@ -1658,8 +1632,6 @@ instance STS PVBUMP where type Signal PVBUMP = () type PredicateFailure PVBUMP = PvbumpPredicateFailure - data Event _ - initialRules = [] transitionRules = [ do @@ -1688,7 +1660,6 @@ instance STS UPIEC where type State UPIEC = UPIState type Signal UPIEC = () type PredicateFailure UPIEC = UpiecPredicateFailure - data Event _ = PVBUMPEvent (Event PVBUMP) initialRules = [] transitionRules = @@ -1720,7 +1691,6 @@ instance STS UPIEC where instance Embed PVBUMP UPIEC where wrapFailed = PVBUMPFailure - wrapEvent = PVBUMPEvent -- | Generate an optional update-proposal and a list of votes, given an update -- environment and state. diff --git a/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Delegation/Properties.hs b/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Delegation/Properties.hs index 1ec3ba05d9..15006d6078 100644 --- a/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Delegation/Properties.hs +++ b/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Delegation/Properties.hs @@ -40,8 +40,8 @@ import Lens.Micro.Extras (view) import Lens.Micro.TH (makeLenses) import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS, - Signal, State, TRC (TRC), Event, applySTS, initialRules, judgmentContext, trans, - transitionRules, wrapFailed, (?!), wrapEvent) + Signal, State, TRC (TRC), applySTS, initialRules, judgmentContext, trans, + transitionRules, wrapFailed, (?!)) import Control.State.Transition.Generator (HasSizeInfo, HasTrace, SignalGenerator, TraceProfile (TraceProfile), classifySize, classifyTraceLength, envGen, failures, isTrivial, nonTrivialTrace, proportionOfValidSignals, sigGen, @@ -109,8 +109,6 @@ instance STS DBLOCK where type State DBLOCK = (DSEnv, DIState) type Signal DBLOCK = DBlock type PredicateFailure DBLOCK = DBlockPredicateFailure - data Event _ = - DELEGEvent (Event DELEG) initialRules = [ do @@ -134,7 +132,6 @@ instance STS DBLOCK where instance Embed DELEG DBLOCK where wrapFailed = DPF - wrapEvent = DELEGEvent -- | Check that all the delegation certificates in the trace were correctly -- applied. diff --git a/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Update/Properties.hs b/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Update/Properties.hs index 41b53fd68e..95543ed074 100644 --- a/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Update/Properties.hs +++ b/byron/ledger/executable-spec/test/Test/Byron/Spec/Ledger/Update/Properties.hs @@ -34,9 +34,9 @@ import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import Numeric.Natural (Natural) -import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS, Event, +import Control.State.Transition (Embed, Environment, IRC (IRC), PredicateFailure, STS, Signal, State, TRC (TRC), initialRules, judgmentContext, trans, - transitionRules, wrapFailed, (?!), wrapEvent) + transitionRules, wrapFailed, (?!)) import Control.State.Transition.Generator (HasTrace, SignalGenerator, envGen, randomTraceOfSize, ratio, sigGen, trace, traceLengthsAreClassified, traceOfLength) @@ -305,11 +305,6 @@ instance STS UBLOCK where type PredicateFailure UBLOCK = UBlockPredicateFailure - data Event _ - = UPIREGEvent (Event UPIREG) - | UPIVOTESEvent (Event UPIVOTES) - | UPIENDEvent (Event UPIEND) - initialRules = [ do IRC env <- judgmentContext @@ -356,15 +351,12 @@ instance STS UBLOCK where instance Embed UPIREG UBLOCK where wrapFailed = UPIREGFailure - wrapEvent = UPIREGEvent instance Embed UPIVOTES UBLOCK where wrapFailed = UPIVOTESFailure - wrapEvent = UPIVOTESEvent instance Embed UPIEND UBLOCK where wrapFailed = UPIENDFailure - wrapEvent = UPIENDEvent instance HasTrace UBLOCK where envGen _ = diff --git a/byron/ledger/impl/test/Test/Cardano/Chain/Update/Gen.hs b/byron/ledger/impl/test/Test/Cardano/Chain/Update/Gen.hs index 456cdb37d0..fea96c4afb 100644 --- a/byron/ledger/impl/test/Test/Cardano/Chain/Update/Gen.hs +++ b/byron/ledger/impl/test/Test/Cardano/Chain/Update/Gen.hs @@ -250,6 +250,6 @@ genEndorsementError = Endorsement.MultipleProposalsForProtocolVersion <$> genProtocolVersion genRegistrationTooLarge :: Gen (Registration.TooLarge Int) -genRegistrationTooLarge = Registration.TooLarge +genRegistrationTooLarge = Registration.TooLarge <$> Gen.int Range.constantBounded <*> Gen.int Range.constantBounded diff --git a/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs b/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs index cba9cbcf9c..5652542a87 100644 --- a/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs +++ b/cardano-ledger-core/src/Cardano/Ledger/Rules/ValidationMode.hs @@ -29,7 +29,7 @@ applySTSValidateSuchThat :: RuleContext rtype s -> m (Either [[PredicateFailure s]] (State s)) applySTSValidateSuchThat cond ctx = - applySTSOpts EPDiscard opts ctx <&> \case + applySTSOpts opts ctx <&> \case (st, []) -> Right st (_, pfs) -> Left pfs where diff --git a/semantics/executable-spec/small-steps.cabal b/semantics/executable-spec/small-steps.cabal index a26dac2e16..585e7e125a 100644 --- a/semantics/executable-spec/small-steps.cabal +++ b/semantics/executable-spec/small-steps.cabal @@ -69,7 +69,6 @@ library , strict-containers , text , transformers >= 0.5 - , writer-cps-mtl -- IOHK deps , cardano-crypto-class , cardano-binary diff --git a/semantics/executable-spec/src/Control/State/Transition/Extended.hs b/semantics/executable-spec/src/Control/State/Transition/Extended.hs index 10c486f0a0..9f072b0dd4 100644 --- a/semantics/executable-spec/src/Control/State/Transition/Extended.hs +++ b/semantics/executable-spec/src/Control/State/Transition/Extended.hs @@ -38,18 +38,12 @@ module Control.State.Transition.Extended (?!), (?!:), Label, - SingEP(..), - EventPolicy(..), - EventReturnType, - EventConstraintType, labeledPred, labeledPredE, failBecause, judgmentContext, trans, liftSTS, - tellEvent, - tellEvents, -- * Apply STS AssertionPolicy (..), @@ -77,16 +71,14 @@ import Control.Monad (when) import Control.Monad.Except (MonadError (..)) import Control.Monad.Free.Church import Control.Monad.Identity (Identity (..)) -import Control.Monad.Trans.Class (lift, MonadTrans) -import Control.Monad.Trans.State.Strict (StateT(..)) -import Control.Monad.Writer.CPS (WriterT, runWriterT) -import Control.Monad.Writer.Class (MonadWriter (..)) -import Control.Monad.State.Class (MonadState (..), modify) +import Control.Monad.Trans.Class (lift) +import Control.Monad.Trans.State.Strict (modify, runStateT) +import qualified Control.Monad.Trans.State.Strict as MonadState import Data.Data (Data, Typeable) import Data.Default.Class (Default, def) import Data.Foldable (find, traverse_) -import Data.Functor ((<&>), ($>)) -import Data.Kind (Type, Constraint) +import Data.Functor ((<&>)) +import Data.Kind (Type) import Data.Proxy (Proxy (..)) import Data.Typeable (typeRep) import NoThunks.Class (NoThunks (..)) @@ -186,12 +178,6 @@ class type BaseM a = Identity - -- | Event type. - data Event a :: Type - - -- type Event a :: Type - -- type Event a = Void - -- | Descriptive type for the possible failures which might cause a transition -- to fail. -- @@ -229,37 +215,9 @@ class class (STS sub, BaseM sub ~ BaseM super) => Embed sub super where -- | Wrap a predicate failure of the subsystem in a failure of the super-system. wrapFailed :: PredicateFailure sub -> PredicateFailure super - wrapEvent :: Event sub -> Event super instance STS sts => Embed sts sts where wrapFailed = id - wrapEvent = id - -data EventPolicy - = EventPolicyReturn - | EventPolicyDiscard - -data SingEP ep where - EPReturn :: SingEP 'EventPolicyReturn - EPDiscard :: SingEP 'EventPolicyDiscard - -type family EventReturnType ep sts a :: Type where - EventReturnType 'EventPolicyReturn sts a = (a, [Event sts]) - EventReturnType _ _ a = a - -type family EventConstraintType e sts m :: Constraint where - EventConstraintType 'EventPolicyReturn sts m = MonadWriter [Event sts] m - EventConstraintType _ _ _ = () - -discardEvents :: forall ep a. SingEP ep -> forall s. EventReturnType ep s a -> a -discardEvents ep = case ep of - EPReturn -> fst - EPDiscard -> id - -getEvents :: forall ep. SingEP ep -> forall s a. EventReturnType ep s a -> [Event s] -getEvents ep ert = case ep of - EPReturn -> snd ert - EPDiscard -> [] data Clause sts (rtype :: RuleType) a where Lift :: @@ -276,10 +234,6 @@ data Clause sts (rtype :: RuleType) a where -- Subsequent computation with state introduced (State sub -> a) -> Clause sts rtype a - Writer :: - [Event sts] -> - a -> - Clause sts rtype a Predicate :: [Label] -> Either e a -> @@ -376,33 +330,32 @@ data ApplySTSOpts = ApplySTSOpts asoValidation :: ValidationPolicy } -type STSInterpreter ep = +type STSInterpreter = forall s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) => RuleContext rtype s -> - m (EventReturnType ep s (State s, [[PredicateFailure s]])) + m (State s, [[PredicateFailure s]]) -type RuleInterpreter ep = +type RuleInterpreter = forall s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) => RuleContext rtype s -> Rule s rtype (State s) -> - m (EventReturnType ep s (State s, [PredicateFailure s])) + m (State s, [PredicateFailure s]) -- | Apply an STS with options. Note that this returns both the final state and -- the list of predicate failures. applySTSOpts :: - forall s m rtype ep. + forall s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) => - SingEP ep -> ApplySTSOpts -> RuleContext rtype s -> - m (EventReturnType ep s (State s, [[PredicateFailure s]])) -applySTSOpts ep ApplySTSOpts {asoAssertions, asoValidation} ctx = - let goRule :: RuleInterpreter ep - goRule = applyRuleInternal ep asoValidation goSTS - goSTS :: STSInterpreter ep - goSTS = applySTSInternal ep asoAssertions goRule + m (State s, [[PredicateFailure s]]) +applySTSOpts ApplySTSOpts {asoAssertions, asoValidation} ctx = + let goRule :: RuleInterpreter + goRule = applyRuleInternal asoValidation goSTS + goSTS :: STSInterpreter + goSTS = applySTSInternal asoAssertions goRule in goSTS ctx applySTS :: @@ -411,7 +364,7 @@ applySTS :: RuleContext rtype s -> m (Either [[PredicateFailure s]] (State s)) applySTS ctx = - applySTSOpts EPDiscard defaultOpts ctx <&> \case + applySTSOpts defaultOpts ctx <&> \case (st, []) -> Right st (_, pfs) -> Left pfs where @@ -441,7 +394,7 @@ reapplySTS :: RuleContext rtype s -> m (State s) reapplySTS ctx = - applySTSOpts EPDiscard defaultOpts ctx <&> fst + applySTSOpts defaultOpts ctx <&> fst where defaultOpts = ApplySTSOpts @@ -455,7 +408,7 @@ applySTSIndifferently :: RuleContext rtype s -> m (State s, [[PredicateFailure s]]) applySTSIndifferently = - applySTSOpts EPDiscard opts + applySTSOpts opts where opts = ApplySTSOpts @@ -463,44 +416,22 @@ applySTSIndifferently = asoValidation = ValidateAll } -newtype RuleEventLoggerT s m a = RuleEventLoggerT (StateT [PredicateFailure s] (WriterT [Event s] m) a) - deriving (MonadWriter [Event s], Monad, Applicative, Functor) - -deriving instance (x ~ [PredicateFailure s], Monad m) => MonadState x (RuleEventLoggerT s m) - -instance MonadTrans (RuleEventLoggerT s) where - lift = RuleEventLoggerT . lift . lift - -runRuleEventLoggerT :: forall s m a. RuleEventLoggerT s m a -> [PredicateFailure s] -> m ((a, [PredicateFailure s]), [Event s]) -runRuleEventLoggerT (RuleEventLoggerT m) s = runWriterT $ runStateT m s - -- | Apply a rule even if its predicates fail. -- -- If the rule successfully applied, the list of predicate failures will be -- empty. applyRuleInternal :: - forall (ep :: EventPolicy) s m rtype. + forall s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) => - SingEP ep -> ValidationPolicy -> -- | Interpreter for subsystems - STSInterpreter ep -> + STSInterpreter -> RuleContext rtype s -> Rule s rtype (State s) -> - m (EventReturnType ep s (State s, [PredicateFailure s])) -applyRuleInternal ep vp goSTS jc r = - case ep of - EPReturn -> flip (runRuleEventLoggerT @s) [] $ foldF runClause r - EPDiscard -> flip runStateT [] $ foldF runClause r + m (State s, [PredicateFailure s]) +applyRuleInternal vp goSTS jc r = flip runStateT [] $ foldF runClause r where - runClause :: forall f t a. - ( f ~ t m - , MonadState [PredicateFailure s] f - , EventConstraintType ep s f - , MonadTrans t - ) - => Clause s rtype a - -> t m a + runClause :: Clause s rtype a -> MonadState.StateT [PredicateFailure s] m a runClause (Lift f next) = next <$> lift f runClause (GetCtx next) = pure $ next jc runClause (Predicate lbls cond orElse val) = @@ -511,52 +442,38 @@ applyRuleInternal ep vp goSTS jc r = Right x -> pure x else pure val runClause (SubTrans (subCtx :: RuleContext _rtype sub) next) = do - s <- lift $ goSTS subCtx - let ss :: State sub - sfails :: [[PredicateFailure sub]] - (ss, sfails) = (discardEvents ep @sub) s + (ss, sfails) <- lift $ goSTS subCtx traverse_ (\a -> modify (a :)) $ wrapFailed @sub @s <$> concat sfails - runClause $ Writer (fmap wrapEvent $ getEvents ep @sub @(State sub, [[PredicateFailure sub]]) s) () pure $ next ss - runClause (Writer w a) = case ep of - EPReturn -> tell w $> a - EPDiscard -> pure a + validateIf lbls = case vp of ValidateAll -> True ValidateNone -> False ValidateSuchThat f -> f lbls applySTSInternal :: - forall s m rtype ep. + forall s m rtype. (STS s, RuleTypeRep rtype, m ~ BaseM s) => - SingEP ep -> AssertionPolicy -> -- | Interpreter for rules - RuleInterpreter ep -> + RuleInterpreter -> RuleContext rtype s -> - m (EventReturnType ep s (State s, [[PredicateFailure s]])) -applySTSInternal ep ap goRule ctx = + m (State s, [[PredicateFailure s]]) +applySTSInternal ap goRule ctx = successOrFirstFailure <$> applySTSInternal' rTypeRep ctx where - successOrFirstFailure :: - [EventReturnType ep s (State s, [PredicateFailure s])] - -> EventReturnType ep s (State s, [[PredicateFailure s]]) successOrFirstFailure xs = - case find (\x -> null $ snd $ (discardEvents ep @s x :: (State s, [PredicateFailure s]))) xs of + case find (null . snd) xs of Nothing -> case xs of [] -> error "applySTSInternal was called with an empty set of rules" - s' : _ -> case ep of - EPDiscard -> (fst s', snd <$> xs) - EPReturn -> ((fst $ fst s', (snd . fst) <$> xs), snd s') - Just s' -> case ep of - EPDiscard -> (fst s', []) - EPReturn -> ((fst $ fst s', []), snd s') + (s, _) : _ -> (s, snd <$> xs) + Just (s, _) -> (s, []) applySTSInternal' :: SRuleType rtype -> RuleContext rtype s -> - m [EventReturnType ep s (State s, [PredicateFailure s])] + m [(State s, [PredicateFailure s])] applySTSInternal' SInitial env = goRule env `traverse` initialRules applySTSInternal' STransition jc = do @@ -581,7 +498,7 @@ applySTSInternal ep ap goRule ctx = res <- goRule jc `traverse` transitionRules -- We only care about running postconditions if the state transition was -- successful. - !_ <- case (assertPost ap, discardEvents ep @s (successOrFirstFailure res) :: (State s, [[PredicateFailure s]])) of + !_ <- case (assertPost ap, successOrFirstFailure res) of (True, (st, [])) -> sfor_ (assertions @s) $! ( \case @@ -642,7 +559,6 @@ instance type Signal (STUB e st si f m) = si type PredicateFailure (STUB e st si f m) = f type BaseM (STUB e st si f m) = m - data Event _ transitionRules = [] initialRules = [] @@ -672,13 +588,3 @@ straverse_ f = foldr c (pure ()) sfor_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () {-# INLINE sfor_ #-} sfor_ = flip straverse_ - -tellEvent :: - Event sts -> - Rule sts ctx () -tellEvent e = tellEvents [e] - -tellEvents :: - [Event sts] -> - Rule sts ctx () -tellEvents es = liftF $ Writer es () diff --git a/semantics/small-steps-test/src/Control/State/Transition/Trace.hs b/semantics/small-steps-test/src/Control/State/Transition/Trace.hs index 108b010d4b..41372eeb19 100644 --- a/semantics/small-steps-test/src/Control/State/Transition/Trace.hs +++ b/semantics/small-steps-test/src/Control/State/Transition/Trace.hs @@ -132,7 +132,6 @@ mkTrace env initState sigs = Trace env initState sigs' -- type State DUMMY = Int -- type Signal DUMMY = String -- type PredicateFailure DUMMY = DummyPredicateFailure --- data Event _ -- initialRules = [] -- transitionRules = [] -- :} @@ -355,7 +354,6 @@ preStatesAndSignals NewestFirst tr -- type State ADDER = Int -- type Signal ADDER = Int -- type PredicateFailure ADDER = AdderPredicateFailure --- data Event _ -- initialRules = [ pure 0 ] -- transitionRules = -- [ do @@ -497,7 +495,7 @@ applySTSTest :: RuleContext rtype s -> m (Either [[PredicateFailure s]] (State s)) applySTSTest ctx = - applySTSOpts EPDiscard defaultOpts ctx <&> \case + applySTSOpts defaultOpts ctx <&> \case (st, []) -> Right st (_, pfs) -> Left pfs where diff --git a/semantics/small-steps-test/test/Control/State/Transition/Examples/CommitReveal.hs b/semantics/small-steps-test/test/Control/State/Transition/Examples/CommitReveal.hs index 9c06ead4ef..d9f282422a 100644 --- a/semantics/small-steps-test/test/Control/State/Transition/Examples/CommitReveal.hs +++ b/semantics/small-steps-test/test/Control/State/Transition/Examples/CommitReveal.hs @@ -22,7 +22,6 @@ import Control.State.Transition STS, Signal, State, - Event, TRC (TRC), initialRules, judgmentContext, @@ -138,8 +137,6 @@ instance PredicateFailure (CR hashAlgo hashToDataMap commitData) = CRPredicateFailure hashAlgo hashToDataMap commitData - data Event _ = Cert - initialRules = [ pure $! CRSt diff --git a/semantics/small-steps-test/test/Control/State/Transition/Examples/GlobalSum.hs b/semantics/small-steps-test/test/Control/State/Transition/Examples/GlobalSum.hs index ee190bda4e..8f3615ba9c 100644 --- a/semantics/small-steps-test/test/Control/State/Transition/Examples/GlobalSum.hs +++ b/semantics/small-steps-test/test/Control/State/Transition/Examples/GlobalSum.hs @@ -33,8 +33,6 @@ instance STS GSUM where type PredicateFailure GSUM = NoFailure - data Event _ - initialRules = [pure 0] transitionRules = diff --git a/semantics/small-steps-test/test/Control/State/Transition/Examples/Sum.hs b/semantics/small-steps-test/test/Control/State/Transition/Examples/Sum.hs index f19a1bb78b..2486f14013 100644 --- a/semantics/small-steps-test/test/Control/State/Transition/Examples/Sum.hs +++ b/semantics/small-steps-test/test/Control/State/Transition/Examples/Sum.hs @@ -34,8 +34,6 @@ instance STS SUM where type PredicateFailure SUM = NoFailure - data Event _ - initialRules = [pure 0] transitionRules = diff --git a/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxo.hs b/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxo.hs index 34caae1cd3..439b239903 100644 --- a/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxo.hs +++ b/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxo.hs @@ -378,7 +378,6 @@ instance type PredicateFailure (UTXO era) = UtxoPredicateFailure era - data Event _ = UpdateEvent (Event (PPUP era)) initialRules = [] transitionRules = [utxoTransition] @@ -391,7 +390,6 @@ instance Embed (PPUP era) (UTXO era) where wrapFailed = UpdateFailure - wrapEvent = UpdateEvent -------------------------------------------------------------------------------- -- Serialisation diff --git a/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxow.hs b/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxow.hs index 6245219b83..142f27dd59 100644 --- a/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxow.hs +++ b/shelley-ma/impl/src/Cardano/Ledger/ShelleyMA/Rules/Utxow.hs @@ -66,8 +66,6 @@ instance type PredicateFailure (UTXOW era) = UtxowPredicateFailure era - data Event _ = UtxoEvent (Event (UTXO era)) - transitionRules = [shelleyStyleWitness witsVKeyNeeded id] -- The ShelleyMA Era uses the same PredicateFailure type @@ -82,15 +80,12 @@ instance Embed (UTXO era) (UTXOW era) where wrapFailed = UtxoFailure - wrapEvent = UtxoEvent instance ( Era era, STS (UTXOW era), - PredicateFailure (Core.EraRule "UTXOW" era) ~ UtxowPredicateFailure era, - Event (Core.EraRule "UTXOW" era) ~ Event (UTXOW era) + PredicateFailure (Core.EraRule "UTXOW" era) ~ UtxowPredicateFailure era ) => Embed (UTXOW era) (Shelley.LEDGER era) where wrapFailed = Shelley.UtxowFailure - wrapEvent = Shelley.UtxowEvent diff --git a/shelley-ma/shelley-ma-test/src/Test/Cardano/Ledger/TranslationTools.hs b/shelley-ma/shelley-ma-test/src/Test/Cardano/Ledger/TranslationTools.hs index b3c52e5479..b1829ade9a 100644 --- a/shelley-ma/shelley-ma-test/src/Test/Cardano/Ledger/TranslationTools.hs +++ b/shelley-ma/shelley-ma-test/src/Test/Cardano/Ledger/TranslationTools.hs @@ -79,7 +79,7 @@ decodeTestAnn _ x = let bytes = serialize x decoded = decodeAnnotator mempty fromCBOR bytes :: Either DecoderError b in case decoded of - Left e -> assertFailure $ + Left e -> assertFailure $ "\nerror: " <> show e <> "\nbytes: " <> show (B16.encode bytes) <> "\n" Right _ -> return () diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Bbody.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Bbody.hs index df0b3d2e2f..91289e937d 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Bbody.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Bbody.hs @@ -137,8 +137,6 @@ instance type BaseM (BBODY era) = ShelleyBase type PredicateFailure (BBODY era) = BbodyPredicateFailure era - data Event _ - = LedgersEvent (Event (Core.EraRule "LEDGERS" era)) -- Subtransition Failures initialRules = [] transitionRules = [bbodyTransition] @@ -205,4 +203,3 @@ instance Embed ledgers (BBODY era) where wrapFailed = LedgersFailure - wrapEvent = LedgersEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Chain.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Chain.hs index 8aff81e0e0..8155200205 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Chain.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Chain.hs @@ -18,7 +18,6 @@ module Shelley.Spec.Ledger.STS.Chain ( CHAIN, ChainState (..), ChainPredicateFailure (..), - Event (..), PredicateFailure, AdaPots (..), initialShelleyState, @@ -271,12 +270,6 @@ instance type PredicateFailure (CHAIN era) = ChainPredicateFailure era - data Event _ - = BbodyEvent (Event (Core.EraRule "BBODY" era)) - | TicknEvent (Event TICKN) - | TickEvent (Event (TICK era)) - | PrtclEvent (Event (PRTCL (Crypto era))) - initialRules = [] transitionRules = [chainTransition] @@ -419,13 +412,11 @@ instance ( Era era, Era era, STS (BBODY era), - PredicateFailure (Core.EraRule "BBODY" era) ~ BbodyPredicateFailure era, - Event (Core.EraRule "BBODY" era) ~ Event (BBODY era) + PredicateFailure (Core.EraRule "BBODY" era) ~ BbodyPredicateFailure era ) => Embed (BBODY era) (CHAIN era) where wrapFailed = BbodyFailure - wrapEvent = BbodyEvent instance ( Era era, @@ -435,7 +426,6 @@ instance Embed TICKN (CHAIN era) where wrapFailed = TicknFailure - wrapEvent = TicknEvent instance ( Era era, @@ -446,7 +436,6 @@ instance Embed (TICK era) (CHAIN era) where wrapFailed = TickFailure - wrapEvent = TickEvent instance ( Era era, @@ -457,7 +446,6 @@ instance Embed (PRTCL c) (CHAIN era) where wrapFailed = PrtclFailure - wrapEvent = PrtclEvent data AdaPots = AdaPots { treasuryAdaPot :: Coin, diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Deleg.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Deleg.hs index f78e25aeb6..e5c65d4f88 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Deleg.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Deleg.hs @@ -149,7 +149,6 @@ instance type Environment (DELEG era) = DelegEnv era type BaseM (DELEG era) = ShelleyBase type PredicateFailure (DELEG era) = DelegPredicateFailure era - data Event _ transitionRules = [delegationTransition] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delegs.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delegs.hs index af98c1ea07..eb76bd6f4d 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delegs.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delegs.hs @@ -136,7 +136,6 @@ instance type PredicateFailure (DELEGS era) = DelegsPredicateFailure era - data Event _ = DelplEvent (Event (DELPL era)) transitionRules = [delegsTransition] @@ -263,4 +262,3 @@ instance Embed (DELPL era) (DELEGS era) where wrapFailed = DelplFailure - wrapEvent = DelplEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delpl.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delpl.hs index bf8edb2370..9af49edc55 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delpl.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Delpl.hs @@ -106,9 +106,6 @@ instance type Environment (DELPL era) = DelplEnv era type BaseM (DELPL era) = ShelleyBase type PredicateFailure (DELPL era) = DelplPredicateFailure era - data Event (DELPL era) - = DelegEvent (Event (DELEG era)) - | PoolEvent (Event (POOL era)) transitionRules = [delplTransition] @@ -200,7 +197,6 @@ instance Embed (POOL era) (DELPL era) where wrapFailed = PoolFailure - wrapEvent = PoolEvent instance ( Era era, @@ -210,4 +206,3 @@ instance Embed (DELEG era) (DELPL era) where wrapFailed = DelegFailure - wrapEvent = DelegEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Epoch.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Epoch.hs index 4d64bc49cc..dc6fec09af 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Epoch.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Epoch.hs @@ -114,10 +114,6 @@ instance type Environment (EPOCH era) = () type BaseM (EPOCH era) = ShelleyBase type PredicateFailure (EPOCH era) = EpochPredicateFailure era - data Event _ - = SnapEvent (Event (SNAP era)) - | PoolReapEvent (Event (POOLREAP era)) - | UpecEvents (Event (UPEC era)) transitionRules = [epochTransition] instance @@ -210,7 +206,6 @@ instance Embed (SNAP era) (EPOCH era) where wrapFailed = SnapFailure - wrapEvent = SnapEvent instance ( Era era, @@ -220,7 +215,6 @@ instance Embed (POOLREAP era) (EPOCH era) where wrapFailed = PoolReapFailure - wrapEvent = PoolReapEvent instance ( Era era, @@ -230,4 +224,3 @@ instance Embed (UPEC era) (EPOCH era) where wrapFailed = UpecFailure - wrapEvent = UpecEvents diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledger.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledger.hs index 401cb3d851..8aaf611758 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledger.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledger.hs @@ -19,7 +19,6 @@ module Shelley.Spec.Ledger.STS.Ledger ( LEDGER, LedgerEnv (..), LedgerPredicateFailure (..), - Event (..), PredicateFailure, ) where @@ -163,9 +162,6 @@ instance type Environment (LEDGER era) = LedgerEnv era type BaseM (LEDGER era) = ShelleyBase type PredicateFailure (LEDGER era) = LedgerPredicateFailure era - data Event _ - = UtxowEvent (Event (Core.EraRule "UTXOW" era)) - | DelegsEvent (Event (DELEGS era)) initialRules = [] transitionRules = [ledgerTransition] @@ -233,15 +229,12 @@ instance Embed (DELEGS era) (LEDGER era) where wrapFailed = DelegsFailure - wrapEvent = DelegsEvent instance ( Era era, STS (UTXOW era), - PredicateFailure (Core.EraRule "UTXOW" era) ~ UtxowPredicateFailure era, - Event (Core.EraRule "UTXOW" era) ~ Event (UTXOW era) + PredicateFailure (Core.EraRule "UTXOW" era) ~ UtxowPredicateFailure era ) => Embed (UTXOW era) (LEDGER era) where wrapFailed = UtxowFailure - wrapEvent = UtxowEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledgers.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledgers.hs index 4bf7784894..c2bf099b2d 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledgers.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ledgers.hs @@ -118,7 +118,6 @@ instance type Environment (LEDGERS era) = LedgersEnv era type BaseM (LEDGERS era) = ShelleyBase type PredicateFailure (LEDGERS era) = LedgersPredicateFailure era - data Event _ = LedgerEvent (Event (LEDGER era)) transitionRules = [ledgersTransition] @@ -153,4 +152,3 @@ instance Embed (LEDGER era) (LEDGERS era) where wrapFailed = LedgerFailure - wrapEvent = LedgerEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Mir.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Mir.hs index 53fde607f7..7aeb7abc27 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Mir.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Mir.hs @@ -67,7 +67,6 @@ instance (Typeable era, Default (EpochState era)) => STS (MIR era) where type Environment (MIR era) = () type BaseM (MIR era) = ShelleyBase type PredicateFailure (MIR era) = MirPredicateFailure era - data Event _ transitionRules = [mirTransition] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/NewEpoch.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/NewEpoch.hs index d79226997c..5aa777b446 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/NewEpoch.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/NewEpoch.hs @@ -98,10 +98,6 @@ instance type BaseM (NEWEPOCH era) = ShelleyBase type PredicateFailure (NEWEPOCH era) = NewEpochPredicateFailure era - data Event _ - = EpochEvent (Event (EPOCH era)) - | MirEvent (Event (MIR era)) - initialRules = [ pure $ NewEpochState @@ -190,7 +186,6 @@ instance Embed (EPOCH era) (NEWEPOCH era) where wrapFailed = EpochFailure - wrapEvent = EpochEvent instance ( Era era, @@ -200,4 +195,3 @@ instance Embed (MIR era) (NEWEPOCH era) where wrapFailed = MirFailure - wrapEvent = MirEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Newpp.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Newpp.hs index 6649f2d39d..cf219c176a 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Newpp.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Newpp.hs @@ -93,7 +93,6 @@ instance type Environment (NEWPP era) = NewppEnv era type BaseM (NEWPP era) = ShelleyBase type PredicateFailure (NEWPP era) = NewppPredicateFailure era - data Event _ transitionRules = [newPpTransition] instance Default (Core.PParams era) => Default (NewppState era) where diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ocert.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ocert.hs index 7341056356..16e0498a94 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ocert.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ocert.hs @@ -71,7 +71,6 @@ instance type Environment (OCERT crypto) = OCertEnv crypto type BaseM (OCERT crypto) = ShelleyBase type PredicateFailure (OCERT crypto) = OcertPredicateFailure crypto - data Event _ initialRules = [pure Map.empty] transitionRules = [ocertTransition] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Overlay.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Overlay.hs index 91fc77014d..953d0c6306 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Overlay.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Overlay.hs @@ -142,9 +142,6 @@ instance type BaseM (OVERLAY crypto) = ShelleyBase type PredicateFailure (OVERLAY crypto) = OverlayPredicateFailure crypto - data Event (OVERLAY crypto) - = OcertEvent (Event (OCERT crypto)) - initialRules = [] transitionRules = [overlayTransition] @@ -296,4 +293,3 @@ instance Embed (OCERT crypto) (OVERLAY crypto) where wrapFailed = OcertFailure - wrapEvent = OcertEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Pool.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Pool.hs index e69a0a42f8..918854a944 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Pool.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Pool.hs @@ -40,7 +40,6 @@ import Control.State.Transition failBecause, judgmentContext, liftSTS, - tellEvent, (?!), ) import Data.Kind (Type) @@ -105,10 +104,6 @@ instance type BaseM (POOL era) = ShelleyBase type PredicateFailure (POOL era) = PoolPredicateFailure era - data Event (POOL era) - = NewPoolParam - | NewFuturePoolParam - transitionRules = [poolDelegationTransition] instance @@ -181,15 +176,13 @@ poolDelegationTransition = do let hk = _poolId poolParam if eval (hk ∉ dom stpools) - then do - -- register new, Pool-Reg - tellEvent NewPoolParam + then -- register new, Pool-Reg + pure $ ps { _pParams = eval (_pParams ps ∪ singleton hk poolParam) } else do - tellEvent NewFuturePoolParam pure $ ps { _fPParams = eval (_fPParams ps ⨃ singleton hk poolParam), diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/PoolReap.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/PoolReap.hs index 621b269fdd..7130bed161 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/PoolReap.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/PoolReap.hs @@ -86,7 +86,6 @@ instance type Environment (POOLREAP era) = Core.PParams era type BaseM (POOLREAP era) = ShelleyBase type PredicateFailure (POOLREAP era) = PoolreapPredicateFailure era - data Event _ transitionRules = [poolReapTransition] assertions = [ PostCondition diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ppup.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ppup.hs index 84061f764b..a572352622 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ppup.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Ppup.hs @@ -92,7 +92,6 @@ instance type Environment (PPUP era) = PPUPEnv era type BaseM (PPUP era) = ShelleyBase type PredicateFailure (PPUP era) = PpupPredicateFailure era - data Event _ initialRules = [] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Prtcl.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Prtcl.hs index c060691615..0f745662a5 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Prtcl.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Prtcl.hs @@ -148,10 +148,6 @@ instance type BaseM (PRTCL crypto) = ShelleyBase type PredicateFailure (PRTCL crypto) = PrtclPredicateFailure crypto - data Event _ - = OverlayEvent (Event (OVERLAY crypto)) - | UpdnEvent (Event (UPDN crypto)) - initialRules = [] transitionRules = [prtclTransition] @@ -203,7 +199,6 @@ instance Embed (OVERLAY crypto) (PRTCL crypto) where wrapFailed = OverlayFailure - wrapEvent = OverlayEvent instance ( Crypto crypto, @@ -214,7 +209,6 @@ instance Embed (UPDN crypto) (PRTCL crypto) where wrapFailed = UpdnFailure - wrapEvent = UpdnEvent data PrtlSeqFailure crypto = WrongSlotIntervalPrtclSeq diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Rupd.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Rupd.hs index ddddfc7a1e..18fc646274 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Rupd.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Rupd.hs @@ -98,7 +98,6 @@ instance type Environment (RUPD era) = RupdEnv era type BaseM (RUPD era) = ShelleyBase type PredicateFailure (RUPD era) = RupdPredicateFailure era - data Event _ initialRules = [pure SNothing] transitionRules = [rupdTransition] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Snap.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Snap.hs index f0861f5ae4..82e45698be 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Snap.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Snap.hs @@ -49,7 +49,6 @@ instance (UsesTxOut era, UsesValue era) => STS (SNAP era) where type Environment (SNAP era) = LedgerState era type BaseM (SNAP era) = ShelleyBase type PredicateFailure (SNAP era) = SnapPredicateFailure era - data Event _ initialRules = [pure emptySnapShots] transitionRules = [snapTransition] diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tick.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tick.hs index bb37cd22fd..41e41f9955 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tick.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tick.hs @@ -91,9 +91,6 @@ instance type Environment (TICK era) = () type BaseM (TICK era) = ShelleyBase type PredicateFailure (TICK era) = TickPredicateFailure era - data Event _ - = NewEpochEvent (Event (NEWEPOCH era)) - | RupdEvent (Event (RUPD era)) initialRules = [] transitionRules = [bheadTransition] @@ -195,7 +192,6 @@ instance Embed (NEWEPOCH era) (TICK era) where wrapFailed = NewEpochFailure - wrapEvent = NewEpochEvent instance ( Era era, @@ -205,7 +201,6 @@ instance Embed (RUPD era) (TICK era) where wrapFailed = RupdFailure - wrapEvent = RupdEvent {------------------------------------------------------------------------------ -- TICKF transition @@ -257,8 +252,6 @@ instance type Environment (TICKF era) = () type BaseM (TICKF era) = ShelleyBase type PredicateFailure (TICKF era) = TickfPredicateFailure era - data Event _ - = TickfNewEpochEvent (Event (NEWEPOCH era)) initialRules = [] transitionRules = @@ -277,4 +270,3 @@ instance Embed (NEWEPOCH era) (TICKF era) where wrapFailed = TickfNewEpochFailure - wrapEvent = TickfNewEpochEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tickn.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tickn.hs index 2848690d6e..48cf9deff7 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tickn.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Tickn.hs @@ -73,7 +73,6 @@ instance STS TICKN where type Environment TICKN = TicknEnv type BaseM TICKN = ShelleyBase type PredicateFailure TICKN = TicknPredicateFailure - data Event _ initialRules = [ pure diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Updn.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Updn.hs index 57a0f2aed0..470b41bb58 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Updn.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Updn.hs @@ -48,7 +48,6 @@ instance type Environment (UPDN crypto) = UpdnEnv type BaseM (UPDN crypto) = ShelleyBase type PredicateFailure (UPDN crypto) = UpdnPredicateFailure crypto - data Event _ initialRules = [ pure ( UpdnState diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Upec.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Upec.hs index 85633f0dae..018d9b0581 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Upec.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Upec.hs @@ -91,8 +91,6 @@ instance type Environment (UPEC era) = EpochState era type BaseM (UPEC era) = ShelleyBase type PredicateFailure (UPEC era) = UpecPredicateFailure era - data Event (UPEC era) - = NewPpEvent (Event (NEWPP era)) initialRules = [] transitionRules = [ do @@ -158,4 +156,3 @@ instance Embed (NEWPP era) (UPEC era) where wrapFailed = NewPpFailure - wrapEvent = NewPpEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxo.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxo.hs index cfe1129a64..d3b46d1ac6 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxo.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxo.hs @@ -73,7 +73,6 @@ import Control.State.Transition judgmentContext, liftSTS, trans, - wrapEvent, wrapFailed, (?!), ) @@ -296,7 +295,6 @@ instance type Environment (UTXO era) = UtxoEnv era type BaseM (UTXO era) = ShelleyBase type PredicateFailure (UTXO era) = UtxoPredicateFailure era - data Event _ = UpdateEvent (Event (PPUP era)) transitionRules = [utxoInductive] @@ -440,4 +438,3 @@ instance Embed (PPUP era) (UTXO era) where wrapFailed = UpdateFailure - wrapEvent = UpdateEvent diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxow.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxow.hs index 799ae7fb37..0660ea1faf 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxow.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/STS/Utxow.hs @@ -75,7 +75,6 @@ import Control.State.Transition judgmentContext, liftSTS, trans, - wrapEvent, wrapFailed, (?!), (?!:), @@ -388,7 +387,6 @@ instance Embed (UTXO era) (UTXOW era) where wrapFailed = UtxoFailure - wrapEvent = UtxoEvent instance ( -- Fix Core.Witnesses to the Shelley Era @@ -411,6 +409,5 @@ instance type Environment (UTXOW era) = UtxoEnv era type BaseM (UTXOW era) = ShelleyBase type PredicateFailure (UTXOW era) = UtxowPredicateFailure era - data Event _ = UtxoEvent (Event (UTXO era)) transitionRules = [shelleyStyleWitness witsVKeyNeeded id] initialRules = [initialLedgerStateUTXOW] diff --git a/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Generator/Trace/DCert.hs b/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Generator/Trace/DCert.hs index 22979d4622..995c586e86 100644 --- a/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Generator/Trace/DCert.hs +++ b/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Generator/Trace/DCert.hs @@ -31,7 +31,6 @@ import Control.State.Transition Environment, PredicateFailure, STS, - Event, Signal, State, TRC (..), @@ -40,7 +39,7 @@ import Control.State.Transition judgmentContext, trans, transitionRules, - wrapFailed, wrapEvent + wrapFailed, ) import Control.State.Transition.Trace (TraceOrder (OldestFirst), lastState, traceSignals) import qualified Control.State.Transition.Trace.Generator.QuickCheck as QC @@ -114,8 +113,6 @@ instance type BaseM (CERTS era) = ShelleyBase - data Event _ = DELPLEvent (Event (DELPL era)) - initialRules = [] transitionRules = [certsTransition] @@ -154,7 +151,6 @@ instance Embed (DELPL era) (CERTS era) where wrapFailed = CertsFailure - wrapEvent = DELPLEvent instance ( EraGen era, diff --git a/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Utils.hs b/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Utils.hs index 4ef8fca3b6..c34f47b88f 100644 --- a/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Utils.hs +++ b/shelley/chain-and-ledger/shelley-spec-ledger-test/src/Test/Shelley/Spec/Ledger/Utils.hs @@ -330,7 +330,7 @@ applySTSTest :: RuleContext rtype s -> m (Either [[PredicateFailure s]] (State s)) applySTSTest ctx = - applySTSOpts EPDiscard defaultOpts ctx <&> \case + applySTSOpts defaultOpts ctx <&> \case (st, []) -> Right st (_, pfs) -> Left pfs where