Skip to content

Commit 52acfaa

Browse files
committed
hlint: import Data.ByteString.Short as SBS
1 parent f9f3960 commit 52acfaa

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

.hlint.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- {name: [Data.Text], as: Text}
3838
- {name: [Data.ByteString.Char8], as: BS}
3939
- {name: [Data.ByteString.Lazy.Char8], as: LBS}
40+
- {name: [Data.ByteString.Short], as: SBS}
4041

4142
# Banned functions
4243
- functions:

cardano-db-sync/src/Cardano/DbSync/Era/Cardano/Util.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Cardano.DbSync.Era.Cardano.Util
55

66
import Cardano.Prelude
77

8-
import qualified Data.ByteString.Short as BSS
8+
import qualified Data.ByteString.Short as SBS
99

1010
import Ouroboros.Consensus.Cardano.Block (CardanoBlock)
1111
import qualified Ouroboros.Consensus.HardFork.Combinator as Consensus
@@ -16,5 +16,5 @@ unChainHash :: ChainHash (CardanoBlock era) -> ByteString
1616
unChainHash ch =
1717
case ch of
1818
GenesisHash -> "genesis"
19-
BlockHash bh -> BSS.fromShort (Consensus.getOneEraHash bh)
19+
BlockHash bh -> SBS.fromShort (Consensus.getOneEraHash bh)
2020

cardano-db-sync/src/Cardano/DbSync/Rollback.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Cardano.DbSync.Rollback
77
) where
88

99
import Cardano.Prelude
10-
import qualified Data.ByteString.Short as BSS
10+
import qualified Data.ByteString.Short as SBS
1111

1212
import Cardano.BM.Trace (Trace, logInfo)
1313

@@ -64,7 +64,7 @@ rollbackToPoint backend trce point =
6464
queryBlockId pnt =
6565
case getPoint pnt of
6666
Origin -> DB.queryGenesis
67-
At blk -> DB.queryBlockId (BSS.fromShort . getOneEraHash $ blockPointHash blk)
67+
At blk -> DB.queryBlockId (SBS.fromShort . getOneEraHash $ blockPointHash blk)
6868

6969
-- For testing and debugging.
7070
unsafeRollback :: Trace IO Text -> SlotNo -> IO (Either SyncNodeError ())

cardano-sync/src/Cardano/Sync/Era/Cardano/Util.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Cardano.Sync.Era.Cardano.Util
55

66
import Cardano.Prelude
77

8-
import qualified Data.ByteString.Short as BSS
8+
import qualified Data.ByteString.Short as SBS
99

1010
import Ouroboros.Consensus.Cardano.Block (CardanoBlock)
1111
import qualified Ouroboros.Consensus.HardFork.Combinator as Consensus
@@ -17,6 +17,6 @@ unChainHash :: ChainHash (CardanoBlock era) -> ByteString
1717
unChainHash ch =
1818
case ch of
1919
GenesisHash -> "genesis"
20-
BlockHash bh -> BSS.fromShort (Consensus.getOneEraHash bh)
20+
BlockHash bh -> SBS.fromShort (Consensus.getOneEraHash bh)
2121

2222

cardano-sync/src/Cardano/Sync/LedgerState.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Control.Monad.Class.MonadSTM.Strict (StrictTMVar, StrictTVar, T
7171
import qualified Data.ByteString.Base16 as Base16
7272
import qualified Data.ByteString.Char8 as BS
7373
import qualified Data.ByteString.Lazy.Char8 as LBS
74-
import qualified Data.ByteString.Short as BSS
74+
import qualified Data.ByteString.Short as SBS
7575
import qualified Data.List as List
7676
import qualified Data.Map.Strict as Map
7777
import qualified Data.Set as Set
@@ -752,7 +752,7 @@ tickThenReapplyCheckHash cfg block lsb =
752752
, " but block previous hash is "
753753
, renderByteArray (Cardano.unChainHash $ blockPrevHash block)
754754
, " and block current hash is "
755-
, renderByteArray (BSS.fromShort . Consensus.getOneEraHash $ blockHash block), "."
755+
, renderByteArray (SBS.fromShort . Consensus.getOneEraHash $ blockHash block), "."
756756
]
757757

758758
totalAdaPots
@@ -762,7 +762,7 @@ totalAdaPots
762762
totalAdaPots = Shelley.totalAdaPotsES . Shelley.nesEs . Consensus.shelleyLedgerState
763763

764764
getHeaderHash :: HeaderHash CardanoBlock -> ByteString
765-
getHeaderHash bh = BSS.fromShort (Consensus.getOneEraHash bh)
765+
getHeaderHash bh = SBS.fromShort (Consensus.getOneEraHash bh)
766766

767767
-- | This will fail if the state is not a 'LedgerStateAlonzo'
768768
getAlonzoPParams :: CardanoLedgerState -> PParams StandardAlonzo

0 commit comments

Comments
 (0)