@@ -195,6 +195,7 @@ import Cardano.Ledger.Keys (
195195 )
196196import Cardano.Ledger.Shelley (ShelleyEra )
197197import Cardano.Ledger.Shelley.API.ByronTranslation (translateToShelleyLedgerStateFromUtxo )
198+ import Cardano.Ledger.Shelley.API.Validation (BlockTransitionError (.. ), applyBlockEither )
198199import Cardano.Ledger.Shelley.AdaPots (sumAdaPots , totalAdaPotsES )
199200import Cardano.Ledger.Shelley.Core
200201import Cardano.Ledger.Shelley.Genesis (
@@ -211,7 +212,6 @@ import Cardano.Ledger.Shelley.LedgerState (
211212 esLStateL ,
212213 lsCertStateL ,
213214 lsUTxOStateL ,
214- nesBcurL ,
215215 nesELL ,
216216 nesEsL ,
217217 prevPParamsEpochStateL ,
@@ -1426,24 +1426,21 @@ tryTxsInBlock act = do
14261426 pure $ Block {blockHeader, blockBody}
14271427
14281428 res <- do
1429+ globals <- use impGlobalsL
14291430 let nes = startingState ^. impNESL
1430- ls = nes ^. nesEsL . esLStateL
1431- pp = nes ^. nesEsL . curPParamsEpochStateL @ era
1432- ca = nes ^. chainAccountStateL
1433- bm = nes ^. nesBcurL
1434- tryRunImpRule @ " BBODY" (BbodyEnv pp ca) (BbodyState ls (BlocksMade bm)) block
1431+ pure $ applyBlockEither EPReturn ValidateAll globals nes block
14351432
14361433 case res of
1437- Left predFailures -> do
1434+ Left ( BlockTransitionError predFailures) -> do
14381435 put startingState
14391436 -- Verify that produced predicate failures are ready for the node-to-client protocol
14401437 liftIO $ forM_ predFailures $ roundTripEraExpectation @ era
14411438 pure $ Left (predFailures, block)
1442- Right (BbodyState bbodyLedgerState _ , events) -> do
1439+ Right (blockNes , events) -> do
14431440 let stsEvents = SomeSTSEvent @ era @ " BBODY" <$> events
1444- bbodyEvents = startingState ^. impEventsL <> Seq. fromList stsEvents
1445- impNESL . nesEsL . esLStateL .= bbodyLedgerState
1446- impEventsL .= bbodyEvents
1441+ blockEvents = startingState ^. impEventsL <> Seq. fromList stsEvents
1442+ impNESL .= blockNes
1443+ impEventsL .= blockEvents
14471444
14481445 pure $ Right block
14491446
0 commit comments