Skip to content

Commit 6b0312d

Browse files
committed
move GenTxId to its own section and describe why it's not an NS of GenTxId
1 parent 091ffe3 commit 6b0312d

File tree

1 file changed

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

1 file changed

+16
-2
lines changed

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

+16-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ newtype OneEraEnvelopeErr xs = OneEraEnvelopeErr { getOneEra
123123
newtype OneEraForgeStateInfo xs = OneEraForgeStateInfo { getOneEraForgeStateInfo :: NS WrapForgeStateInfo xs }
124124
newtype OneEraForgeStateUpdateError xs = OneEraForgeStateUpdateError { getOneEraForgeStateUpdateError :: NS WrapForgeStateUpdateError xs }
125125
newtype OneEraGenTx xs = OneEraGenTx { getOneEraGenTx :: NS GenTx xs }
126-
newtype OneEraGenTxId xs = OneEraGenTxId { getOneEraGenTxId :: ShortByteString }
127-
deriving (Show, Eq, Ord, Generic, NoThunks)
128126
newtype OneEraHeader xs = OneEraHeader { getOneEraHeader :: NS Header xs }
129127
newtype OneEraIsLeader xs = OneEraIsLeader { getOneEraIsLeader :: NS WrapIsLeader xs }
130128
newtype OneEraLedgerError xs = OneEraLedgerError { getOneEraLedgerError :: NS WrapLedgerErr xs }
@@ -159,6 +157,22 @@ instance Show (OneEraHash xs) where
159157
instance Condense (OneEraHash xs) where
160158
condense = show
161159

160+
{-------------------------------------------------------------------------------
161+
GenTxId
162+
-------------------------------------------------------------------------------}
163+
164+
-- | The GenTxId for an era
165+
--
166+
-- This type is special in effectively the same way as OneEraHash (and for
167+
-- basically the same reason, too) -- it doesn't use an NS, because we don't
168+
-- want to be able to differentiate eras' 'GenTxId's. Ideally, 'OneEraGenTxId'
169+
-- would be serialised simply as a 'ShortByteString', but for backwards
170+
-- compatibility reasons we /pretend/ that it's always a Shelley-era 'GenTxId'
171+
-- when we're communicating with other nodes or clients that don't support the
172+
-- new serialisation format.
173+
newtype OneEraGenTxId xs = OneEraGenTxId { getOneEraGenTxId :: ShortByteString }
174+
deriving (Show, Eq, Ord, Generic, NoThunks)
175+
162176
{-------------------------------------------------------------------------------
163177
Value for two /different/ eras
164178
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)