diff --git a/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs b/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs index d9f6a16d1ea..cdc1be6e401 100644 --- a/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs +++ b/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs @@ -53,7 +53,6 @@ import Codec.Serialise (decode, encode) import Control.Arrow (left) import qualified Control.Exception as Exception import Control.Monad.Except -import Data.Coerce (coerce) import Data.Functor ((<&>)) import Data.Functor.Identity import qualified Data.Text as Text @@ -82,8 +81,8 @@ import Ouroboros.Consensus.Util.CBOR (decodeWithOrigin, encodeWithOrigin) import Ouroboros.Consensus.Util.Versioned -import qualified Cardano.Ledger.BaseTypes as SL (epochInfoPure) import qualified Cardano.Ledger.BHeaderView as SL (BHeaderView) +import qualified Cardano.Ledger.BaseTypes as SL (epochInfoPure) import qualified Cardano.Ledger.Core as Core import qualified Cardano.Ledger.Shelley.API as SL import qualified Control.State.Transition.Extended as STS @@ -194,7 +193,7 @@ castShelleyTip :: castShelleyTip (ShelleyTip sn bn hh) = ShelleyTip { shelleyTipSlotNo = sn , shelleyTipBlockNo = bn - , shelleyTipHash = coerce hh + , shelleyTipHash = hh } data instance LedgerState (ShelleyBlock proto era) = ShelleyLedgerState { diff --git a/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Protocol/Abstract.hs b/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Protocol/Abstract.hs index 22f54ee4720..10681516523 100644 --- a/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Protocol/Abstract.hs +++ b/ouroboros-consensus-shelley/src/Ouroboros/Consensus/Shelley/Protocol/Abstract.hs @@ -27,14 +27,14 @@ module Ouroboros.Consensus.Shelley.Protocol.Abstract ( ) where import Cardano.Binary (FromCBOR (fromCBOR), ToCBOR (toCBOR)) +import Cardano.Crypto.Hash (Hash) import Cardano.Crypto.VRF (OutputVRF) -import Cardano.Ledger.BaseTypes (ProtVer) import Cardano.Ledger.BHeaderView (BHeaderView) -import Cardano.Ledger.Crypto (Crypto, VRF) +import Cardano.Ledger.BaseTypes (ProtVer) +import Cardano.Ledger.Crypto (Crypto, HASH, VRF) import Cardano.Ledger.Hashes (EraIndependentBlockBody, EraIndependentBlockHeader) -import Cardano.Ledger.Keys (Hash, KeyRole (BlockIssuer), VKey) -import qualified Cardano.Ledger.Keys as SL (Hash) +import Cardano.Ledger.Keys (KeyRole (BlockIssuer), VKey) import Cardano.Protocol.TPraos.BHeader (PrevHash) import Cardano.Slotting.Block (BlockNo) import Cardano.Slotting.Slot (SlotNo) @@ -65,7 +65,7 @@ type family ProtoCrypto proto :: Type -------------------------------------------------------------------------------} newtype ShelleyHash crypto = ShelleyHash - { unShelleyHash :: SL.Hash crypto EraIndependentBlockHeader + { unShelleyHash :: Hash (HASH crypto) EraIndependentBlockHeader } deriving stock (Eq, Ord, Show, Generic) deriving anyclass (NoThunks) @@ -105,7 +105,7 @@ class where pHeaderHash :: ShelleyProtocolHeader proto -> ShelleyHash (ProtoCrypto proto) pHeaderPrevHash :: ShelleyProtocolHeader proto -> PrevHash (ProtoCrypto proto) - pHeaderBodyHash :: ShelleyProtocolHeader proto -> Hash (ProtoCrypto proto) EraIndependentBlockBody + pHeaderBodyHash :: ShelleyProtocolHeader proto -> Hash (HASH (ProtoCrypto proto)) EraIndependentBlockBody pHeaderSlot :: ShelleyProtocolHeader proto -> SlotNo pHeaderBlock :: ShelleyProtocolHeader proto -> BlockNo pHeaderSize :: ShelleyProtocolHeader proto -> Natural @@ -154,7 +154,7 @@ class ProtocolHeaderSupportsKES proto where -- | Hash of the previous block PrevHash crypto -> -- | Hash of the block body to include in the header - Hash crypto EraIndependentBlockBody -> + Hash (HASH crypto) EraIndependentBlockBody -> -- | Size of the block body Int -> -- | Protocol version