bolt2

Lightning peer protocol, per BOLT #2 (docs.ppad.tech/bolt2).
git clone git://git.ppad.tech/bolt2.git
Log | Files | Refs | README | LICENSE

commit 9b1bba63ec1957bb6cf27bd49050ff60fff31e18
parent 89df0389196ed8ba5c010320ad4002741dd98771
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 10 Oct 2026 14:23:10 +0400

lib: disambiguate haddock references to record types

Diffstat:
Mlib/Lightning/Protocol/BOLT2/Codec.hs | 116++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mlib/Lightning/Protocol/BOLT2/Types.hs | 20++++++++++----------
2 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/lib/Lightning/Protocol/BOLT2/Codec.hs b/lib/Lightning/Protocol/BOLT2/Codec.hs @@ -500,7 +500,7 @@ decode_message bs = do open_channel_known :: [Word64] open_channel_known = [0, 1] --- | Encode an 'OpenChannel' payload. +-- | Encode an t'OpenChannel' payload. encode_open_channel :: OpenChannel -> Either EncodeError BS.ByteString encode_open_channel m = do ts <- encode_tlvs open_channel_known @@ -529,7 +529,7 @@ encode_open_channel m = do , ts ] --- | Decode an 'OpenChannel' payload. +-- | Decode an t'OpenChannel' payload. decode_open_channel :: BS.ByteString -> Either DecodeError OpenChannel decode_open_channel = parse $ do ch <- chain_hash @@ -582,7 +582,7 @@ decode_open_channel = parse $ do accept_channel_known :: [Word64] accept_channel_known = [0, 1] --- | Encode an 'AcceptChannel' payload. +-- | Encode an t'AcceptChannel' payload. encode_accept_channel :: AcceptChannel -> Either EncodeError BS.ByteString encode_accept_channel m = do ts <- encode_tlvs accept_channel_known @@ -607,7 +607,7 @@ encode_accept_channel m = do , ts ] --- | Decode an 'AcceptChannel' payload. +-- | Decode an t'AcceptChannel' payload. decode_accept_channel :: BS.ByteString -> Either DecodeError AcceptChannel decode_accept_channel = parse $ do tcid <- channel_id @@ -649,7 +649,7 @@ decode_accept_channel = parse $ do -- funding_created, funding_signed -------------------------------------------- --- | Encode a 'FundingCreated' payload. +-- | Encode a t'FundingCreated' payload. encode_funding_created :: FundingCreated -> BS.ByteString encode_funding_created m = mconcat [ BOLT1.un_channel_id (funding_created_temporary_channel_id m) @@ -659,12 +659,12 @@ encode_funding_created m = mconcat [ , BOLT1.encode_tlv_stream (funding_created_tlvs m) ] --- | Decode a 'FundingCreated' payload. +-- | Decode a t'FundingCreated' payload. decode_funding_created :: BS.ByteString -> Either DecodeError FundingCreated decode_funding_created = parse $ FundingCreated <$> channel_id <*> txid <*> u16 <*> signature <*> tlvs [] --- | Encode a 'FundingSigned' payload. +-- | Encode a t'FundingSigned' payload. encode_funding_signed :: FundingSigned -> BS.ByteString encode_funding_signed m = mconcat [ BOLT1.un_channel_id (funding_signed_channel_id m) @@ -672,7 +672,7 @@ encode_funding_signed m = mconcat [ , BOLT1.encode_tlv_stream (funding_signed_tlvs m) ] --- | Decode a 'FundingSigned' payload. +-- | Decode a t'FundingSigned' payload. decode_funding_signed :: BS.ByteString -> Either DecodeError FundingSigned decode_funding_signed = parse $ FundingSigned <$> channel_id <*> signature <*> tlvs [] @@ -682,7 +682,7 @@ decode_funding_signed = parse $ channel_ready_known :: [Word64] channel_ready_known = [1] --- | Encode a 'ChannelReady' payload. +-- | Encode a t'ChannelReady' payload. encode_channel_ready :: ChannelReady -> Either EncodeError BS.ByteString encode_channel_ready m = do ts <- encode_tlvs channel_ready_known @@ -694,7 +694,7 @@ encode_channel_ready m = do , ts ] --- | Decode a 'ChannelReady' payload. +-- | Decode a t'ChannelReady' payload. decode_channel_ready :: BS.ByteString -> Either DecodeError ChannelReady decode_channel_ready = parse $ do cid <- channel_id @@ -708,7 +708,7 @@ decode_channel_ready = parse $ do opening_known :: [Word64] opening_known = [0, 1, 2] --- | Encode an 'OpenChannel2' payload. +-- | Encode an t'OpenChannel2' payload. encode_open_channel2 :: OpenChannel2 -> Either EncodeError BS.ByteString encode_open_channel2 m = do ts <- encode_tlvs opening_known @@ -739,7 +739,7 @@ encode_open_channel2 m = do , ts ] --- | Decode an 'OpenChannel2' payload. +-- | Decode an t'OpenChannel2' payload. decode_open_channel2 :: BS.ByteString -> Either DecodeError OpenChannel2 decode_open_channel2 = parse $ do ch <- chain_hash @@ -793,7 +793,7 @@ decode_open_channel2 = parse $ do -- accept_channel2 ------------------------------------------------------------ --- | Encode an 'AcceptChannel2' payload. +-- | Encode an t'AcceptChannel2' payload. encode_accept_channel2 :: AcceptChannel2 -> Either EncodeError BS.ByteString encode_accept_channel2 m = do ts <- encode_tlvs opening_known @@ -820,7 +820,7 @@ encode_accept_channel2 m = do , ts ] --- | Decode an 'AcceptChannel2' payload. +-- | Decode an t'AcceptChannel2' payload. decode_accept_channel2 :: BS.ByteString -> Either DecodeError AcceptChannel2 decode_accept_channel2 = parse $ do tcid <- channel_id @@ -866,7 +866,7 @@ decode_accept_channel2 = parse $ do -- interactive transaction construction --------------------------------------- --- | Encode a 'TxAddInput' payload. Fails if @prevtx@ exceeds 65535 +-- | Encode a t'TxAddInput' payload. Fails if @prevtx@ exceeds 65535 -- bytes. encode_tx_add_input :: TxAddInput -> Either EncodeError BS.ByteString encode_tx_add_input m = do @@ -881,13 +881,13 @@ encode_tx_add_input m = do , BOLT1.encode_tlv_stream (tx_add_input_tlvs m) ] --- | Decode a 'TxAddInput' payload. +-- | Decode a t'TxAddInput' payload. decode_tx_add_input :: BS.ByteString -> Either DecodeError TxAddInput decode_tx_add_input = parse $ TxAddInput <$> channel_id <*> serial_id <*> prefixed <*> u32 <*> u32 <*> tlvs [] --- | Encode a 'TxAddOutput' payload. +-- | Encode a t'TxAddOutput' payload. encode_tx_add_output :: TxAddOutput -> BS.ByteString encode_tx_add_output m = let SerialId sid = tx_add_output_serial_id m @@ -899,13 +899,13 @@ encode_tx_add_output m = , BOLT1.encode_tlv_stream (tx_add_output_tlvs m) ] --- | Decode a 'TxAddOutput' payload. +-- | Decode a t'TxAddOutput' payload. decode_tx_add_output :: BS.ByteString -> Either DecodeError TxAddOutput decode_tx_add_output = parse $ TxAddOutput <$> channel_id <*> serial_id <*> satoshi <*> script <*> tlvs [] --- | Encode a 'TxRemoveInput' payload. +-- | Encode a t'TxRemoveInput' payload. encode_tx_remove_input :: TxRemoveInput -> BS.ByteString encode_tx_remove_input (TxRemoveInput cid (SerialId sid) ts) = mconcat [ BOLT1.un_channel_id cid @@ -913,12 +913,12 @@ encode_tx_remove_input (TxRemoveInput cid (SerialId sid) ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode a 'TxRemoveInput' payload. +-- | Decode a t'TxRemoveInput' payload. decode_tx_remove_input :: BS.ByteString -> Either DecodeError TxRemoveInput decode_tx_remove_input = parse $ TxRemoveInput <$> channel_id <*> serial_id <*> tlvs [] --- | Encode a 'TxRemoveOutput' payload. +-- | Encode a t'TxRemoveOutput' payload. encode_tx_remove_output :: TxRemoveOutput -> BS.ByteString encode_tx_remove_output (TxRemoveOutput cid (SerialId sid) ts) = mconcat [ BOLT1.un_channel_id cid @@ -926,22 +926,22 @@ encode_tx_remove_output (TxRemoveOutput cid (SerialId sid) ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode a 'TxRemoveOutput' payload. +-- | Decode a t'TxRemoveOutput' payload. decode_tx_remove_output :: BS.ByteString -> Either DecodeError TxRemoveOutput decode_tx_remove_output = parse $ TxRemoveOutput <$> channel_id <*> serial_id <*> tlvs [] --- | Encode a 'TxComplete' payload. +-- | Encode a t'TxComplete' payload. encode_tx_complete :: TxComplete -> BS.ByteString encode_tx_complete (TxComplete cid ts) = BOLT1.un_channel_id cid <> BOLT1.encode_tlv_stream ts --- | Decode a 'TxComplete' payload. +-- | Decode a t'TxComplete' payload. decode_tx_complete :: BS.ByteString -> Either DecodeError TxComplete decode_tx_complete = parse $ TxComplete <$> channel_id <*> tlvs [] --- | Encode a 'TxSignatures' payload. Fails if there are more than 65535 +-- | Encode a t'TxSignatures' payload. Fails if there are more than 65535 -- witnesses. encode_tx_signatures :: TxSignatures -> Either EncodeError BS.ByteString encode_tx_signatures m = do @@ -956,7 +956,7 @@ encode_tx_signatures m = do , BOLT1.encode_tlv_stream (tx_signatures_tlvs m) ] --- | Decode a 'TxSignatures' payload. +-- | Decode a t'TxSignatures' payload. decode_tx_signatures :: BS.ByteString -> Either DecodeError TxSignatures decode_tx_signatures = parse $ do cid <- channel_id @@ -972,7 +972,7 @@ decode_tx_signatures = parse $ do rbf_known :: [Word64] rbf_known = [0, 2] --- | Encode a 'TxInitRbf' payload. +-- | Encode a t'TxInitRbf' payload. encode_tx_init_rbf :: TxInitRbf -> Either EncodeError BS.ByteString encode_tx_init_rbf m = do ts <- encode_tlvs rbf_known @@ -986,7 +986,7 @@ encode_tx_init_rbf m = do , ts ] --- | Decode a 'TxInitRbf' payload. +-- | Decode a t'TxInitRbf' payload. decode_tx_init_rbf :: BS.ByteString -> Either DecodeError TxInitRbf decode_tx_init_rbf = parse $ do cid <- channel_id @@ -997,7 +997,7 @@ decode_tx_init_rbf = parse $ do conf <- flag 2 s pure (TxInitRbf cid lock fee contrib conf (unknown rbf_known s)) --- | Encode a 'TxAckRbf' payload. +-- | Encode a t'TxAckRbf' payload. encode_tx_ack_rbf :: TxAckRbf -> Either EncodeError BS.ByteString encode_tx_ack_rbf m = do ts <- encode_tlvs rbf_known @@ -1006,7 +1006,7 @@ encode_tx_ack_rbf m = do (tx_ack_rbf_tlvs m) pure (BOLT1.un_channel_id (tx_ack_rbf_channel_id m) <> ts) --- | Decode a 'TxAckRbf' payload. +-- | Decode a t'TxAckRbf' payload. decode_tx_ack_rbf :: BS.ByteString -> Either DecodeError TxAckRbf decode_tx_ack_rbf = parse $ do cid <- channel_id @@ -1015,19 +1015,19 @@ decode_tx_ack_rbf = parse $ do conf <- flag 2 s pure (TxAckRbf cid contrib conf (unknown rbf_known s)) --- | Encode a 'TxAbort' payload. Fails if @data@ exceeds 65535 bytes. +-- | Encode a t'TxAbort' payload. Fails if @data@ exceeds 65535 bytes. encode_tx_abort :: TxAbort -> Either EncodeError BS.ByteString encode_tx_abort (TxAbort cid dat ts) = do dat' <- u16_prefixed dat pure (BOLT1.un_channel_id cid <> dat' <> BOLT1.encode_tlv_stream ts) --- | Decode a 'TxAbort' payload. +-- | Decode a t'TxAbort' payload. decode_tx_abort :: BS.ByteString -> Either DecodeError TxAbort decode_tx_abort = parse $ TxAbort <$> channel_id <*> prefixed <*> tlvs [] -- stfu ----------------------------------------------------------------------- --- | Encode a 'Stfu' payload. +-- | Encode a t'Stfu' payload. encode_stfu :: Stfu -> BS.ByteString encode_stfu (Stfu cid ini ts) = mconcat [ BOLT1.un_channel_id cid @@ -1035,7 +1035,7 @@ encode_stfu (Stfu cid ini ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode a 'Stfu' payload. The @initiator@ byte must be 0 or 1. +-- | Decode a t'Stfu' payload. The @initiator@ byte must be 0 or 1. decode_stfu :: BS.ByteString -> Either DecodeError Stfu decode_stfu = parse $ do cid <- channel_id @@ -1048,7 +1048,7 @@ decode_stfu = parse $ do -- shutdown ------------------------------------------------------------------- --- | Encode a 'Shutdown' payload. +-- | Encode a t'Shutdown' payload. encode_shutdown :: Shutdown -> BS.ByteString encode_shutdown (Shutdown cid spk ts) = mconcat [ BOLT1.un_channel_id cid @@ -1056,7 +1056,7 @@ encode_shutdown (Shutdown cid spk ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode a 'Shutdown' payload. +-- | Decode a t'Shutdown' payload. decode_shutdown :: BS.ByteString -> Either DecodeError Shutdown decode_shutdown = parse $ Shutdown <$> channel_id <*> script <*> tlvs [] @@ -1072,7 +1072,7 @@ closing_records a b c = <> opt 2 BOLT1.un_signature b <> opt 3 BOLT1.un_signature c --- | Encode a 'ClosingComplete' payload. +-- | Encode a t'ClosingComplete' payload. encode_closing_complete :: ClosingComplete -> Either EncodeError BS.ByteString encode_closing_complete m = do ts <- encode_tlvs closing_known @@ -1090,7 +1090,7 @@ encode_closing_complete m = do , ts ] --- | Decode a 'ClosingComplete' payload. +-- | Decode a t'ClosingComplete' payload. decode_closing_complete :: BS.ByteString -> Either DecodeError ClosingComplete decode_closing_complete = parse $ do @@ -1106,7 +1106,7 @@ decode_closing_complete = parse $ do pure (ClosingComplete cid closer closee fee lock a b c (unknown closing_known s)) --- | Encode a 'ClosingSig' payload. +-- | Encode a t'ClosingSig' payload. encode_closing_sig :: ClosingSig -> Either EncodeError BS.ByteString encode_closing_sig m = do ts <- encode_tlvs closing_known @@ -1124,7 +1124,7 @@ encode_closing_sig m = do , ts ] --- | Decode a 'ClosingSig' payload. +-- | Decode a t'ClosingSig' payload. decode_closing_sig :: BS.ByteString -> Either DecodeError ClosingSig decode_closing_sig = parse $ do cid <- channel_id @@ -1144,7 +1144,7 @@ decode_closing_sig = parse $ do closing_signed_known :: [Word64] closing_signed_known = [1] --- | Encode a 'ClosingSigned' payload. +-- | Encode a t'ClosingSigned' payload. encode_closing_signed :: ClosingSigned -> Either EncodeError BS.ByteString encode_closing_signed m = do ts <- encode_tlvs closing_signed_known @@ -1157,7 +1157,7 @@ encode_closing_signed m = do , ts ] --- | Decode a 'ClosingSigned' payload. +-- | Decode a t'ClosingSigned' payload. decode_closing_signed :: BS.ByteString -> Either DecodeError ClosingSigned decode_closing_signed = parse $ do cid <- channel_id @@ -1172,7 +1172,7 @@ decode_closing_signed = parse $ do update_add_htlc_known :: [Word64] update_add_htlc_known = [0] --- | Encode an 'UpdateAddHtlc' payload. +-- | Encode an t'UpdateAddHtlc' payload. encode_update_add_htlc :: UpdateAddHtlc -> Either EncodeError BS.ByteString encode_update_add_htlc m = do ts <- encode_tlvs update_add_htlc_known @@ -1189,7 +1189,7 @@ encode_update_add_htlc m = do , ts ] --- | Decode an 'UpdateAddHtlc' payload. +-- | Decode an t'UpdateAddHtlc' payload. decode_update_add_htlc :: BS.ByteString -> Either DecodeError UpdateAddHtlc decode_update_add_htlc = parse $ do cid <- channel_id @@ -1208,7 +1208,7 @@ decode_update_add_htlc = parse $ do update_fulfill_htlc_known :: [Word64] update_fulfill_htlc_known = [1, 3] --- | Encode an 'UpdateFulfillHtlc' payload. +-- | Encode an t'UpdateFulfillHtlc' payload. encode_update_fulfill_htlc :: UpdateFulfillHtlc -> Either EncodeError BS.ByteString encode_update_fulfill_htlc m = do @@ -1224,7 +1224,7 @@ encode_update_fulfill_htlc m = do , ts ] --- | Decode an 'UpdateFulfillHtlc' payload. +-- | Decode an t'UpdateFulfillHtlc' payload. decode_update_fulfill_htlc :: BS.ByteString -> Either DecodeError UpdateFulfillHtlc decode_update_fulfill_htlc = parse $ do @@ -1242,7 +1242,7 @@ decode_update_fulfill_htlc = parse $ do update_fail_htlc_known :: [Word64] update_fail_htlc_known = [1] --- | Encode an 'UpdateFailHtlc' payload. Fails if @reason@ exceeds 65535 +-- | Encode an t'UpdateFailHtlc' payload. Fails if @reason@ exceeds 65535 -- bytes. encode_update_fail_htlc :: UpdateFailHtlc -> Either EncodeError BS.ByteString encode_update_fail_htlc m = do @@ -1258,7 +1258,7 @@ encode_update_fail_htlc m = do , ts ] --- | Decode an 'UpdateFailHtlc' payload. +-- | Decode an t'UpdateFailHtlc' payload. decode_update_fail_htlc :: BS.ByteString -> Either DecodeError UpdateFailHtlc decode_update_fail_htlc = parse $ do cid <- channel_id @@ -1270,7 +1270,7 @@ decode_update_fail_htlc = parse $ do -- update_fail_malformed_htlc ------------------------------------------------- --- | Encode an 'UpdateFailMalformedHtlc' payload. +-- | Encode an t'UpdateFailMalformedHtlc' payload. encode_update_fail_malformed_htlc :: UpdateFailMalformedHtlc -> BS.ByteString encode_update_fail_malformed_htlc (UpdateFailMalformedHtlc cid (HtlcId hid) oh code ts) = mconcat [ @@ -1281,7 +1281,7 @@ encode_update_fail_malformed_htlc , BOLT1.encode_tlv_stream ts ] --- | Decode an 'UpdateFailMalformedHtlc' payload. +-- | Decode an t'UpdateFailMalformedHtlc' payload. decode_update_fail_malformed_htlc :: BS.ByteString -> Either DecodeError UpdateFailMalformedHtlc decode_update_fail_malformed_htlc = parse $ @@ -1293,7 +1293,7 @@ decode_update_fail_malformed_htlc = parse $ commitment_signed_known :: [Word64] commitment_signed_known = [1] --- | Encode a 'CommitmentSigned' payload. Fails if there are more than +-- | Encode a t'CommitmentSigned' payload. Fails if there are more than -- 65535 HTLC signatures. encode_commitment_signed :: CommitmentSigned -> Either EncodeError BS.ByteString @@ -1311,7 +1311,7 @@ encode_commitment_signed m = do , ts ] --- | Decode a 'CommitmentSigned' payload. +-- | Decode a t'CommitmentSigned' payload. decode_commitment_signed :: BS.ByteString -> Either DecodeError CommitmentSigned decode_commitment_signed = parse $ do @@ -1325,7 +1325,7 @@ decode_commitment_signed = parse $ do -- revoke_and_ack, update_fee ------------------------------------------------- --- | Encode a 'RevokeAndAck' payload. +-- | Encode a t'RevokeAndAck' payload. encode_revoke_and_ack :: RevokeAndAck -> BS.ByteString encode_revoke_and_ack (RevokeAndAck cid sec pcp ts) = mconcat [ BOLT1.un_channel_id cid @@ -1334,12 +1334,12 @@ encode_revoke_and_ack (RevokeAndAck cid sec pcp ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode a 'RevokeAndAck' payload. +-- | Decode a t'RevokeAndAck' payload. decode_revoke_and_ack :: BS.ByteString -> Either DecodeError RevokeAndAck decode_revoke_and_ack = parse $ RevokeAndAck <$> channel_id <*> per_commitment_secret <*> point <*> tlvs [] --- | Encode an 'UpdateFee' payload. +-- | Encode an t'UpdateFee' payload. encode_update_fee :: UpdateFee -> BS.ByteString encode_update_fee (UpdateFee cid fee ts) = mconcat [ BOLT1.un_channel_id cid @@ -1347,7 +1347,7 @@ encode_update_fee (UpdateFee cid fee ts) = mconcat [ , BOLT1.encode_tlv_stream ts ] --- | Decode an 'UpdateFee' payload. +-- | Decode an t'UpdateFee' payload. decode_update_fee :: BS.ByteString -> Either DecodeError UpdateFee decode_update_fee = parse $ UpdateFee <$> channel_id <*> u32 <*> tlvs [] @@ -1356,7 +1356,7 @@ decode_update_fee = parse $ UpdateFee <$> channel_id <*> u32 <*> tlvs [] channel_reestablish_known :: [Word64] channel_reestablish_known = [1] --- | Encode a 'ChannelReestablish' payload. +-- | Encode a t'ChannelReestablish' payload. encode_channel_reestablish :: ChannelReestablish -> Either EncodeError BS.ByteString encode_channel_reestablish m = do @@ -1373,7 +1373,7 @@ encode_channel_reestablish m = do , ts ] --- | Decode a 'ChannelReestablish' payload. +-- | Decode a t'ChannelReestablish' payload. decode_channel_reestablish :: BS.ByteString -> Either DecodeError ChannelReestablish decode_channel_reestablish = parse $ do diff --git a/lib/Lightning/Protocol/BOLT2/Types.hs b/lib/Lightning/Protocol/BOLT2/Types.hs @@ -60,7 +60,7 @@ newtype ScriptPubKey = ScriptPubKey BS.ByteString instance NFData ScriptPubKey --- | Construct a 'ScriptPubKey', failing above 65535 bytes. The script +-- | Construct a t'ScriptPubKey', failing above 65535 bytes. The script -- itself isn't checked; the forms acceptable in @shutdown@ depend on -- negotiated features. -- @@ -74,7 +74,7 @@ script_pubkey bs | otherwise = Nothing {-# INLINE script_pubkey #-} --- | The bytes of a 'ScriptPubKey'. +-- | The bytes of a t'ScriptPubKey'. un_script_pubkey :: ScriptPubKey -> BS.ByteString un_script_pubkey (ScriptPubKey bs) = bs {-# INLINE un_script_pubkey #-} @@ -86,7 +86,7 @@ newtype Witness = Witness BS.ByteString instance NFData Witness --- | Construct a 'Witness', failing above 65535 bytes. The contents +-- | Construct a t'Witness', failing above 65535 bytes. The contents -- aren't checked. -- -- >>> witness "\x01\x01\x2a" @@ -97,7 +97,7 @@ witness bs | otherwise = Nothing {-# INLINE witness #-} --- | The bytes of a 'Witness'. +-- | The bytes of a t'Witness'. un_witness :: Witness -> BS.ByteString un_witness (Witness bs) = bs {-# INLINE un_witness #-} @@ -109,7 +109,7 @@ newtype OnionRoutingPacket = OnionRoutingPacket BS.ByteString instance NFData OnionRoutingPacket --- | Construct an 'OnionRoutingPacket' from exactly 1366 bytes. +-- | Construct an t'OnionRoutingPacket' from exactly 1366 bytes. -- -- >>> let bs = BS.replicate 1366 0x00 -- >>> fmap un_onion_routing_packet (onion_routing_packet bs) == Just bs @@ -122,7 +122,7 @@ onion_routing_packet bs | otherwise = Nothing {-# INLINE onion_routing_packet #-} --- | The bytes of an 'OnionRoutingPacket'. +-- | The bytes of an t'OnionRoutingPacket'. un_onion_routing_packet :: OnionRoutingPacket -> BS.ByteString un_onion_routing_packet (OnionRoutingPacket bs) = bs {-# INLINE un_onion_routing_packet #-} @@ -134,7 +134,7 @@ newtype OnionHash = OnionHash BS.ByteString instance NFData OnionHash --- | Construct an 'OnionHash' from exactly 32 bytes. +-- | Construct an t'OnionHash' from exactly 32 bytes. -- -- >>> onion_hash (BS.replicate 31 0x00) -- Nothing @@ -144,7 +144,7 @@ onion_hash bs | otherwise = Nothing {-# INLINE onion_hash #-} --- | The bytes of an 'OnionHash'. +-- | The bytes of an t'OnionHash'. un_onion_hash :: OnionHash -> BS.ByteString un_onion_hash (OnionHash bs) = bs {-# INLINE un_onion_hash #-} @@ -157,7 +157,7 @@ newtype AttributionData = AttributionData BS.ByteString instance NFData AttributionData --- | Construct an 'AttributionData' from exactly 920 bytes. +-- | Construct an t'AttributionData' from exactly 920 bytes. -- -- >>> let bs = BS.replicate 920 0x00 -- >>> fmap un_attribution_data (attribution_data bs) == Just bs @@ -170,7 +170,7 @@ attribution_data bs | otherwise = Nothing {-# INLINE attribution_data #-} --- | The bytes of an 'AttributionData'. +-- | The bytes of an t'AttributionData'. un_attribution_data :: AttributionData -> BS.ByteString un_attribution_data (AttributionData bs) = bs {-# INLINE un_attribution_data #-}