bolt7

Routing gossip protocol, per BOLT #7 (docs.ppad.tech/bolt7).
git clone git://git.ppad.tech/bolt7.git
Log | Files | Refs | README | LICENSE

commit c0e79c96c9d92301db4d829af50c5728a9f5a6c4
parent c51ce0bfe60ad6541235f06fe6a5161a25bdf7a0
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 10 Oct 2026 14:43:35 +0400

lib, test: wrap lines over 80 characters

Diffstat:
Mlib/Lightning/Protocol/BOLT7/Codec.hs | 6++++--
Mtest/Main.hs | 6++++--
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/Lightning/Protocol/BOLT7/Codec.hs b/lib/Lightning/Protocol/BOLT7/Codec.hs @@ -544,7 +544,8 @@ decode_reply_channel_range b0 = do , rcr_short_channel_ids = scids , rcr_timestamps = ts , rcr_checksums = cs - , rcr_tlvs = BOLT1.filter_tlv_stream (\t -> t /= 1 && t /= 3) s + , rcr_tlvs = + BOLT1.filter_tlv_stream (\t -> t /= 1 && t /= 3) s } where timestamps n v = case BS.uncons v of @@ -698,7 +699,8 @@ merge :: [Word64] -> [TlvRecord] -> TlvStream -> Either EncodeError BS.ByteString merge known typed extra | any ((`elem` known) . tlv_type) rs = Left EncodeInvalidTlvs - | otherwise = maybe (Left EncodeInvalidTlvs) (Right . BOLT1.encode_tlv_stream) + | otherwise = + maybe (Left EncodeInvalidTlvs) (Right . BOLT1.encode_tlv_stream) (BOLT1.tlv_stream (typed <> rs)) where rs = BOLT1.un_tlv_stream extra diff --git a/test/Main.hs b/test/Main.hs @@ -226,7 +226,8 @@ field_tests = testGroup "field types" [ -- the vectors' chain hash (regtest) regtest :: IO ChainHash -regtest = hex "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206" +regtest = hex + "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206" >>= must "chain_hash" . BOLT1.chain_hash scids :: [(Word32, Word32, Word16)] -> IO [ShortChannelId] @@ -583,7 +584,8 @@ channel_update_tests = testGroup "channel_update" [ encode_channel_update d @?= wire , testCase "keeps unassigned flag bits" $ do u <- fixtures >>= update_fixture - let wire = set_byte 109 0xfd (set_byte 108 0xfc (encode_channel_update u)) + let wire = set_byte 109 0xfd + (set_byte 108 0xfc (encode_channel_update u)) d <- expectRight "decode" (decode_channel_update wire) cu_message_flags d @?= MessageFlags 0xfc cu_channel_flags d @?= ChannelFlags 0xfd