Skip to content

Commit 64a0f2d

Browse files
committed
WIP Ledger: adapt to changes in runAnnotator
The commit should be revised
1 parent 83219ea commit 64a0f2d

File tree

2 files changed

+9
-3
lines changed
  • ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger

2 files changed

+9
-3
lines changed

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import Cardano.Protocol.Crypto (Crypto)
6262
import qualified Cardano.Protocol.TPraos.BHeader as SL
6363
import qualified Data.ByteString.Lazy as Lazy
6464
import Data.Coerce (coerce)
65+
import Data.Either (fromRight)
6566
import Data.Typeable (Typeable)
6667
import GHC.Generics (Generic)
6768
import NoThunks.Class (NoThunks (..))
@@ -311,7 +312,9 @@ decodeShelleyBlock ::
311312
ShelleyCompatible proto era =>
312313
forall s.
313314
Plain.Decoder s (Lazy.ByteString -> ShelleyBlock proto era)
314-
decodeShelleyBlock = eraDecoder @era $ (. Full) . runAnnotator <$> decCBOR
315+
decodeShelleyBlock =
316+
eraDecoder @era $
317+
(. Full) . (fromRight (error "TODO(geo2a): remove fromRight") .) . runAnnotator <$> decCBOR
315318

316319
shelleyBinaryBlockInfo ::
317320
forall proto era. ShelleyCompatible proto era => ShelleyBlock proto era -> BinaryBlockInfo
@@ -335,7 +338,9 @@ decodeShelleyHeader ::
335338
ShelleyCompatible proto era =>
336339
forall s.
337340
Plain.Decoder s (Lazy.ByteString -> Header (ShelleyBlock proto era))
338-
decodeShelleyHeader = eraDecoder @era $ (. Full) . runAnnotator <$> decCBOR
341+
decodeShelleyHeader =
342+
eraDecoder @era $
343+
(. Full) . (fromRight (error "TODO(geo2a): remove fromRight") .) . runAnnotator <$> decCBOR
339344

340345
{-------------------------------------------------------------------------------
341346
Condense

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import Control.Monad (guard)
8787
import Control.Monad.Except (Except, liftEither)
8888
import Control.Monad.Identity (Identity (..))
8989
import Data.DerivingVia (InstantiatedAt (..))
90+
import Data.Either (fromRight)
9091
import Data.Foldable (toList)
9192
import Data.Measure (Measure)
9293
import Data.Typeable (Typeable)
@@ -245,7 +246,7 @@ instance ShelleyCompatible proto era => FromCBOR (GenTx (ShelleyBlock proto era)
245246
fmap mkShelleyTx $
246247
unwrapCBORinCBOR $
247248
eraDecoder @era $
248-
(. Full) . runAnnotator <$> decCBOR
249+
(. Full) . (fromRight (error "TODO(geo2a): remove fromRight") .) . runAnnotator <$> decCBOR
249250

250251
{-------------------------------------------------------------------------------
251252
Pretty-printing

0 commit comments

Comments
 (0)