From 2e5d4d8751cbf17ca5f114f357320395e4597e02 Mon Sep 17 00:00:00 2001 From: Fraser Murray Date: Thu, 12 Dec 2024 12:14:56 +0000 Subject: [PATCH] simplify Inject WrapGenTxId and make it match Inject WrapHeaderHash --- .../Consensus/HardFork/Combinator/Embed/Nary.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed/Nary.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed/Nary.hs index 0bb3d1a13a..42a47dccb3 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed/Nary.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Embed/Nary.hs @@ -137,8 +137,14 @@ instance Inject GenTx where inject _ = injectNS' (Proxy @GenTx) instance Inject WrapGenTxId where - inject _ ix w = WrapGenTxId $ HardForkGenTxId $ OneEraGenTxId $ - hcollapse $ hcmap proxySingle (K . toRawTxIdHash . unwrapGenTxId) $ injectNS ix w + inject _ (idx :: Index xs x) = + case dictIndexAll (Proxy @SingleEraBlock) idx of + Dict -> + WrapGenTxId + . HardForkGenTxId + . OneEraGenTxId + . toRawTxIdHash + . unwrapGenTxId instance Inject WrapApplyTxErr where inject _ =