commit 47348be1c4bf0679000c6afafbbc6d95f62bddc7
parent 83eda90bde6eb40729825472d0e28f2025e13f9f
Author: Jared Tobin <jared@jtobin.io>
Date: Sat, 10 Oct 2026 13:34:32 +0400
test: BOLT #4 route-blinding allowed_features vectors
Diffstat:
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/test/Main.hs b/test/Main.hs
@@ -21,6 +21,7 @@ main = defaultMain $ testGroup "ppad-bolt9" [
, local_tests
, remote_tests
, invoice_tests
+ , blinded_tests
, channel_type_tests
, properties
]
@@ -407,6 +408,22 @@ invoice_tests = testGroup "BOLT #11 invoice features" [
validate_local InvoiceContext (bits [8, 14, 48]) @?= Right ()
]
+-- BOLT #4 vectors -----------------------------------------------------------
+
+-- | allowed_features from bolt04/route-blinding-test.json.
+blinded_tests :: TestTree
+blinded_tests = testGroup "BOLT #4 allowed_features" [
+ testCase "features [] (Bob, Carol, Dave)" $ do
+ set_bits (parse "") @?= []
+ validate_remote BlindedContext (parse "") @?= Right ()
+
+ , testCase "features [113] (Eve)" $ do
+ let fv = parse (BS.pack (0x02 : replicate 14 0))
+ set_bits fv @?= [113]
+ validate_remote BlindedContext fv @?= Left (UnknownBit 113 :| [])
+ validate_local BlindedContext fv @?= Left (UnknownBit 113 :| [])
+ ]
+
-- channel types -------------------------------------------------------------
all_channel_types :: [ChannelType]