Skip to content

Commit 37690bd

Browse files
committed
fix warnings
1 parent 27bb25b commit 37690bd

File tree

4 files changed

+11
-39
lines changed

4 files changed

+11
-39
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/AcrossEras.hs

-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ import qualified Data.ByteString.Base16 as B16
6868
import qualified Data.ByteString.Char8 as BSC
6969
import Data.ByteString.Short (ShortByteString)
7070
import qualified Data.ByteString.Short as Short
71-
import Data.Function (on)
7271
import Data.Proxy
7372
import Data.SOP.BasicFunctors
7473
import Data.SOP.Constraint
@@ -249,9 +248,6 @@ getSameValue values =
249248
| otherwise
250249
= throwError "differing values across hard fork"
251250

252-
oneEraGenTxIdRawHash :: CanHardFork xs => OneEraGenTxId xs -> ShortByteString
253-
oneEraGenTxIdRawHash = getOneEraGenTxId
254-
255251
{-------------------------------------------------------------------------------
256252
NoThunks instances
257253
-------------------------------------------------------------------------------}

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed/Nary.hs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module Ouroboros.Consensus.HardFork.Combinator.Embed.Nary (
2121

2222
import Data.Bifunctor (first)
2323
import Data.Coerce (Coercible, coerce)
24-
import Data.SOP (Compose)
2524
import Data.SOP.BasicFunctors
2625
import Data.SOP.Counting (Exactly (..))
2726
import Data.SOP.Dict (Dict (..))

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Serialisation/SerialiseNodeToClient.hs

+6-26
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import Codec.CBOR.Encoding (Encoding)
2323
import qualified Codec.CBOR.Encoding as Enc
2424
import qualified Codec.Serialise as Serialise
2525
import Control.Exception (throw)
26-
import Data.ByteString.Short (ShortByteString)
2726
import Data.Proxy
2827
import Data.SOP.BasicFunctors
2928
import Data.SOP.Constraint
@@ -39,15 +38,14 @@ import Ouroboros.Consensus.HardFork.Combinator.Mempool
3938
import Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common
4039
import Ouroboros.Consensus.HardFork.Combinator.Serialisation.SerialiseDisk ()
4140
import Ouroboros.Consensus.HardFork.History (EraParamsFormat (..))
42-
import Ouroboros.Consensus.Ledger.SupportsMempool (GenTxId,
43-
toRawTxIdHash)
41+
import Ouroboros.Consensus.Ledger.SupportsMempool (GenTxId)
4442
import Ouroboros.Consensus.Node.NetworkProtocolVersion
4543
import Ouroboros.Consensus.Node.Run
4644
import Ouroboros.Consensus.Node.Serialisation
47-
import Ouroboros.Consensus.TypeFamilyWrappers
4845
import Ouroboros.Consensus.Util ((.:))
4946
import Ouroboros.Network.Block (Serialised, unwrapCBORinCBOR,
5047
wrapCBORinCBOR)
48+
import Data.ByteString.Short (ShortByteString)
5149

5250
instance SerialiseHFC xs => SerialiseNodeToClientConstraints (HardForkBlock xs)
5351

@@ -172,7 +170,7 @@ instance SerialiseHFC xs
172170
-- need to handle the cases where 'ShortByteString's are serialised with
173171
-- an era tag ('encodeNS').
174172

175-
encodeNodeToClient cc v (HardForkGenTxId (OneEraGenTxId txid)) =
173+
encodeNodeToClient _cc v (HardForkGenTxId (OneEraGenTxId txid)) =
176174
case v of
177175
HardForkNodeToClientEnabled hfv _ | hfv >= HardForkSpecificNodeToClientVersion4 ->
178176
Serialise.encode txid
@@ -182,31 +180,13 @@ instance SerialiseHFC xs
182180
encodeNS (hpure $ Fn $ K . Serialise.encode . unK) blessedGenTxId
183181
HardForkNodeToClientDisabled _ ->
184182
Serialise.encode txid
185-
decodeNodeToClient cc v =
183+
decodeNodeToClient _cc v =
186184
fmap (HardForkGenTxId . OneEraGenTxId) $
187185
case v of
188-
HardForkNodeToClientEnabled hfc vs
186+
HardForkNodeToClientEnabled hfc _
189187
| hfc >= HardForkSpecificNodeToClientVersion4 -> do
190188
Serialise.decode
191-
-- let aux :: forall s blk . SerialiseConstraintsHFC blk
192-
-- => CodecConfig blk
193-
-- -> EraNodeToClientVersion blk
194-
-- -> K () blk
195-
-- -> (Decoder s :.: WrapGenTxId) blk
196-
-- aux ecc vv _ = Comp $ case vv of
197-
-- EraNodeToClientEnabled bv -> do
198-
-- decodeNodeToClient ecc bv
199-
-- EraNodeToClientDisabled ->
200-
-- -- Is this sensible? What should the behaviour be when the
201-
-- -- blessed GenTxId era is disabled by EraNodeToClientDisabled?
202-
-- fail $ show $ disabledEraException (Proxy @blk)
203-
-- htraverse' unComp $
204-
-- hcliftA3 pSHFC
205-
-- aux
206-
-- (getPerEraCodecConfig (hardForkCodecConfigPerEra cc))
207-
-- vs
208-
-- blessedGenTxIdEra
209-
HardForkNodeToClientEnabled _ _ ->do
189+
HardForkNodeToClientEnabled _ _ -> do
210190
let eraDecoders :: NP (Decoder s :.: K ShortByteString) xs
211191
eraDecoders = hpure $ Comp $ K <$> Serialise.decode
212192
hcollapse <$> decodeNS eraDecoders

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Serialisation/SerialiseNodeToNode.hs

+5-8
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,20 @@ instance SerialiseHFC xs
147147
-- need to handle the cases where 'ShortByteString's are serialised with
148148
-- an era tag ('encodeNS').
149149

150-
encodeNodeToNode cc v (HardForkGenTxId (OneEraGenTxId txid)) = do
150+
encodeNodeToNode _cc v (HardForkGenTxId (OneEraGenTxId txid)) = do
151151
case v of
152152
HardForkNodeToNodeEnabled hfv _ | hfv >= HardForkSpecificNodeToNodeVersion2 ->
153153
Serialise.encode txid
154-
HardForkNodeToNodeEnabled _ vs -> do
155-
154+
HardForkNodeToNodeEnabled _ _ -> do
156155
let blessedGenTxId :: NS (K ShortByteString) xs
157156
blessedGenTxId = hmap (pure $ K txid) blessedGenTxIdEra
158-
case blessedGenTxId of
159-
Z i -> Serialise.encode $ unK i
160-
S x -> encodeNS (hpure $ Fn $ K . Serialise.encode . unK) blessedGenTxId
157+
encodeNS (hpure $ Fn $ K . Serialise.encode . unK) blessedGenTxId
161158
HardForkNodeToNodeDisabled _ ->
162159
Serialise.encode txid
163-
decodeNodeToNode cc v =
160+
decodeNodeToNode _cc v =
164161
fmap (HardForkGenTxId . OneEraGenTxId) $
165162
case v of
166-
HardForkNodeToNodeEnabled hfv vs | hfv >= HardForkSpecificNodeToNodeVersion2 ->
163+
HardForkNodeToNodeEnabled hfv _ | hfv >= HardForkSpecificNodeToNodeVersion2 ->
167164
Serialise.decode
168165
HardForkNodeToNodeEnabled _ _ -> do
169166
let eraDecoders :: NP (Decoder s :.: K ShortByteString) xs

0 commit comments

Comments
 (0)