File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ def data(self) -> Bits:
4141 for route in self .routes :
4242 route_hints .append (
4343 BitArray (hex = route .public_key )
44- + pack ("intbe :64" , scid_to_int (route .short_channel_id ))
45- + pack ("intbe :32" , route .base_fee )
46- + pack ("intbe :32" , route .ppm_fee )
47- + pack ("intbe :16" , route .cltv_expiry_delta )
44+ + pack ("uintbe :64" , scid_to_int (route .short_channel_id ))
45+ + pack ("uintbe :32" , route .base_fee )
46+ + pack ("uintbe :32" , route .ppm_fee )
47+ + pack ("uintbe :16" , route .cltv_expiry_delta )
4848 )
4949
5050 return route_hints
Original file line number Diff line number Diff line change @@ -100,3 +100,23 @@ def test_route_hint_unordered(self):
100100 check_decoded_routes (decoded .route_hints , ex ["route_hints" ])
101101 re_encoded = encode (decoded )
102102 assert re_encoded == ex ["payment_request" ]
103+
104+
105+ class TestRouteHintsSize :
106+ def test_channel_id_size (self ):
107+ big_channel_id = "16774490x12969991x22027"
108+ hints = RouteHint .from_list (
109+ [
110+ {
111+ "public_key" : (
112+ "029e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255"
113+ ),
114+ "short_channel_id" : big_channel_id ,
115+ "base_fee" : 1 ,
116+ "ppm_fee" : 20 ,
117+ "cltv_expiry_delta" : 3 ,
118+ }
119+ ]
120+ )
121+
122+ assert hints .data
You can’t perform that action at this time.
0 commit comments