@@ -2706,8 +2706,8 @@ impl Writeable for OutboundTrampolinePayload {
27062706}
27072707
27082708
2709- impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , & NS ) > for InboundOnionPayload where NS :: Target : NodeSigner {
2710- fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , & NS ) ) -> Result < Self , DecodeError > {
2709+ impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , NS ) > for InboundOnionPayload where NS :: Target : NodeSigner {
2710+ fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , NS ) ) -> Result < Self , DecodeError > {
27112711 let ( update_add_blinding_point, node_signer) = args;
27122712
27132713 let mut amt = None ;
@@ -4406,7 +4406,7 @@ mod tests {
44064406 assert_eq ! ( encoded_value, target_value) ;
44074407
44084408 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4409- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4409+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
44104410 if let msgs:: InboundOnionPayload :: Forward {
44114411 short_channel_id, amt_to_forward, outgoing_cltv_value
44124412 } = inbound_msg {
@@ -4431,7 +4431,7 @@ mod tests {
44314431 assert_eq ! ( encoded_value, target_value) ;
44324432
44334433 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4434- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4434+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
44354435 if let msgs:: InboundOnionPayload :: Receive {
44364436 payment_data : None , sender_intended_htlc_amt_msat, cltv_expiry_height, ..
44374437 } = inbound_msg {
@@ -4459,7 +4459,7 @@ mod tests {
44594459 assert_eq ! ( encoded_value, target_value) ;
44604460
44614461 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4462- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4462+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
44634463 if let msgs:: InboundOnionPayload :: Receive {
44644464 payment_data : Some ( FinalOnionHopData {
44654465 payment_secret,
@@ -4495,7 +4495,7 @@ mod tests {
44954495 } ;
44964496 let encoded_value = msg. encode ( ) ;
44974497 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4498- assert ! ( msgs:: InboundOnionPayload :: read( & mut Cursor :: new( & encoded_value[ ..] ) , ( None , && node_signer) ) . is_err( ) ) ;
4498+ assert ! ( msgs:: InboundOnionPayload :: read( & mut Cursor :: new( & encoded_value[ ..] ) , ( None , & node_signer) ) . is_err( ) ) ;
44994499 let good_type_range_tlvs = vec ! [
45004500 ( ( 1 << 16 ) - 3 , vec![ 42 ] ) ,
45014501 ( ( 1 << 16 ) - 1 , vec![ 42 ; 32 ] ) ,
@@ -4504,7 +4504,7 @@ mod tests {
45044504 * custom_tlvs = & good_type_range_tlvs;
45054505 }
45064506 let encoded_value = msg. encode ( ) ;
4507- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & encoded_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4507+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & encoded_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
45084508 match inbound_msg {
45094509 msgs:: InboundOnionPayload :: Receive { custom_tlvs, .. } => assert ! ( custom_tlvs. is_empty( ) ) ,
45104510 _ => panic ! ( ) ,
@@ -4529,7 +4529,7 @@ mod tests {
45294529 let target_value = <Vec < u8 > >:: from_hex ( "2e02080badf00d010203040404ffffffffff0000000146c6616b021234ff0000000146c6616f084242424242424242" ) . unwrap ( ) ;
45304530 assert_eq ! ( encoded_value, target_value) ;
45314531 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4532- let inbound_msg: msgs:: InboundOnionPayload = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4532+ let inbound_msg: msgs:: InboundOnionPayload = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
45334533 if let msgs:: InboundOnionPayload :: Receive {
45344534 payment_data : None ,
45354535 payment_metadata : None ,
@@ -4759,7 +4759,7 @@ mod tests {
47594759 let mut rd = Cursor :: new ( & big_payload[ ..] ) ;
47604760
47614761 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4762- <msgs:: InboundOnionPayload as ReadableArgs < ( Option < PublicKey > , & & test_utils:: TestKeysInterface ) > >
4762+ <msgs:: InboundOnionPayload as ReadableArgs < ( Option < PublicKey > , & test_utils:: TestKeysInterface ) > >
47634763 :: read ( & mut rd, ( None , & & node_signer) ) . unwrap ( ) ;
47644764 }
47654765 // see above test, needs to be a separate method for use of the serialization macros.
0 commit comments