@@ -2756,8 +2756,8 @@ impl Writeable for OutboundTrampolinePayload {
27562756}
27572757
27582758
2759- impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , & NS ) > for InboundOnionPayload where NS :: Target : NodeSigner {
2760- fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , & NS ) ) -> Result < Self , DecodeError > {
2759+ impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , NS ) > for InboundOnionPayload where NS :: Target : NodeSigner {
2760+ fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , NS ) ) -> Result < Self , DecodeError > {
27612761 let ( update_add_blinding_point, node_signer) = args;
27622762
27632763 let mut amt = None ;
@@ -4456,7 +4456,7 @@ mod tests {
44564456 assert_eq ! ( encoded_value, target_value) ;
44574457
44584458 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4459- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4459+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
44604460 if let msgs:: InboundOnionPayload :: Forward {
44614461 short_channel_id, amt_to_forward, outgoing_cltv_value
44624462 } = inbound_msg {
@@ -4481,7 +4481,7 @@ mod tests {
44814481 assert_eq ! ( encoded_value, target_value) ;
44824482
44834483 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4484- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4484+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
44854485 if let msgs:: InboundOnionPayload :: Receive {
44864486 payment_data : None , sender_intended_htlc_amt_msat, cltv_expiry_height, ..
44874487 } = inbound_msg {
@@ -4509,7 +4509,7 @@ mod tests {
45094509 assert_eq ! ( encoded_value, target_value) ;
45104510
45114511 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4512- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4512+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
45134513 if let msgs:: InboundOnionPayload :: Receive {
45144514 payment_data : Some ( FinalOnionHopData {
45154515 payment_secret,
@@ -4545,7 +4545,7 @@ mod tests {
45454545 } ;
45464546 let encoded_value = msg. encode ( ) ;
45474547 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4548- assert ! ( msgs:: InboundOnionPayload :: read( & mut Cursor :: new( & encoded_value[ ..] ) , ( None , && node_signer) ) . is_err( ) ) ;
4548+ assert ! ( msgs:: InboundOnionPayload :: read( & mut Cursor :: new( & encoded_value[ ..] ) , ( None , & node_signer) ) . is_err( ) ) ;
45494549 let good_type_range_tlvs = vec ! [
45504550 ( ( 1 << 16 ) - 3 , vec![ 42 ] ) ,
45514551 ( ( 1 << 16 ) - 1 , vec![ 42 ; 32 ] ) ,
@@ -4554,7 +4554,7 @@ mod tests {
45544554 * custom_tlvs = & good_type_range_tlvs;
45554555 }
45564556 let encoded_value = msg. encode ( ) ;
4557- let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & encoded_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4557+ let inbound_msg = ReadableArgs :: read ( & mut Cursor :: new ( & encoded_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
45584558 match inbound_msg {
45594559 msgs:: InboundOnionPayload :: Receive { custom_tlvs, .. } => assert ! ( custom_tlvs. is_empty( ) ) ,
45604560 _ => panic ! ( ) ,
@@ -4579,7 +4579,7 @@ mod tests {
45794579 let target_value = <Vec < u8 > >:: from_hex ( "2e02080badf00d010203040404ffffffffff0000000146c6616b021234ff0000000146c6616f084242424242424242" ) . unwrap ( ) ;
45804580 assert_eq ! ( encoded_value, target_value) ;
45814581 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4582- let inbound_msg: msgs:: InboundOnionPayload = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & & node_signer) ) . unwrap ( ) ;
4582+ let inbound_msg: msgs:: InboundOnionPayload = ReadableArgs :: read ( & mut Cursor :: new ( & target_value[ ..] ) , ( None , & node_signer) ) . unwrap ( ) ;
45834583 if let msgs:: InboundOnionPayload :: Receive {
45844584 payment_data : None ,
45854585 payment_metadata : None ,
@@ -4809,7 +4809,7 @@ mod tests {
48094809 let mut rd = Cursor :: new ( & big_payload[ ..] ) ;
48104810
48114811 let node_signer = test_utils:: TestKeysInterface :: new ( & [ 42 ; 32 ] , Network :: Testnet ) ;
4812- <msgs:: InboundOnionPayload as ReadableArgs < ( Option < PublicKey > , & & test_utils:: TestKeysInterface ) > >
4812+ <msgs:: InboundOnionPayload as ReadableArgs < ( Option < PublicKey > , & test_utils:: TestKeysInterface ) > >
48134813 :: read ( & mut rd, ( None , & & node_signer) ) . unwrap ( ) ;
48144814 }
48154815 // see above test, needs to be a separate method for use of the serialization macros.
0 commit comments