Skip to content

Commit 9089409

Browse files
committed
simplify Inject WrapGenTxId and make it match Inject WrapHeaderHash
1 parent 99e5c56 commit 9089409

File tree

1 file changed

+8
-2
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed

1 file changed

+8
-2
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,14 @@ instance Inject GenTx where
137137
inject _ = injectNS' (Proxy @GenTx)
138138

139139
instance Inject WrapGenTxId where
140-
inject _ ix w = WrapGenTxId $ HardForkGenTxId $ OneEraGenTxId $
141-
hcollapse $ hcmap proxySingle (K . toRawTxIdHash . unwrapGenTxId) $ injectNS ix w
140+
inject _ (idx :: Index xs x) =
141+
case dictIndexAll (Proxy @SingleEraBlock) idx of
142+
Dict ->
143+
WrapGenTxId
144+
. HardForkGenTxId
145+
. OneEraGenTxId
146+
. toRawTxIdHash
147+
. unwrapGenTxId
142148

143149
instance Inject WrapApplyTxErr where
144150
inject _ =

0 commit comments

Comments
 (0)