Skip to content

Commit

Permalink
Remove fromPrevHash and fromChainHash
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Nov 13, 2023
1 parent c96a733 commit cde36ec
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions lib/wallet/src/Cardano/Wallet/Shelley/Compatibility.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ module Cardano.Wallet.Shelley.Compatibility
, fromBlockNo
, toCardanoEra
, fromShelleyTxOut
, fromCardanoHash
, fromChainHash
, fromPrevHash
, fromGenesisData
, fromTip
, fromTip'
Expand Down Expand Up @@ -353,7 +350,6 @@ import Ouroboros.Consensus.Shelley.Ledger.Block
)
import Ouroboros.Network.Block
( BlockNo (..)
, ChainHash
, Point (..)
, Tip (..)
, getTipPoint
Expand Down Expand Up @@ -574,22 +570,6 @@ toCardanoEra = \case
fromCardanoHash :: O.HeaderHash (CardanoBlock sc) -> W.Hash "BlockHeader"
fromCardanoHash = W.Hash . fromShort . getOneEraHash

fromPrevHash
:: W.Hash "BlockHeader"
-> SL.PrevHash crypto
-> W.Hash "BlockHeader"
fromPrevHash genesisHash = \case
SL.GenesisHash -> genesisHash
SL.BlockHash (SL.HashHeader h) -> W.Hash (hashToBytes h)

fromChainHash
:: W.Hash "Genesis"
-> ChainHash (CardanoBlock sc)
-> W.Hash "BlockHeader"
fromChainHash genesisHash = \case
O.GenesisHash -> coerce genesisHash
O.BlockHash (OneEraHash h) -> W.Hash $ fromShort h

-- FIXME unsafe conversion (Word64 -> Word32)
fromBlockNo :: BlockNo -> Quantity "block" Word32
fromBlockNo (BlockNo h) = Quantity (fromIntegral h)
Expand Down Expand Up @@ -860,7 +840,8 @@ slottingParametersFromGenesis g =
, getEpochLength =
W.EpochLength . fromIntegral . unEpochSize $ sgEpochLength g
, getActiveSlotCoefficient =
W.ActiveSlotCoefficient . fromRational . SL.unboundRational $ sgActiveSlotsCoeff g
W.ActiveSlotCoefficient . fromRational . SL.unboundRational
$ sgActiveSlotsCoeff g
, getSecurityParameter =
Quantity . fromIntegral $ sgSecurityParam g
}
Expand Down

0 comments on commit cde36ec

Please sign in to comment.