File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1403,7 +1403,10 @@ impl LengthReadable for Bolt12Invoice {
14031403 reader : & mut R ,
14041404 ) -> Result < Self , DecodeError > {
14051405 let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
1406- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1406+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1407+ Bolt12ParseError :: Decode ( e) => e,
1408+ _ => DecodeError :: InvalidValue ,
1409+ } )
14071410 }
14081411}
14091412
Original file line number Diff line number Diff line change @@ -1123,7 +1123,10 @@ impl Writeable for InvoiceRequestContents {
11231123impl LengthReadable for InvoiceRequest {
11241124 fn read_from_fixed_length_buffer < R : LengthLimitedRead > ( r : & mut R ) -> Result < Self , DecodeError > {
11251125 let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( r) ?;
1126- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1126+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1127+ Bolt12ParseError :: Decode ( e) => e,
1128+ _ => DecodeError :: InvalidValue ,
1129+ } )
11271130 }
11281131}
11291132
Original file line number Diff line number Diff line change @@ -1039,7 +1039,10 @@ impl LengthReadable for Offer {
10391039 reader : & mut R ,
10401040 ) -> Result < Self , DecodeError > {
10411041 let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
1042- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
1042+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
1043+ Bolt12ParseError :: Decode ( e) => e,
1044+ _ => DecodeError :: InvalidValue ,
1045+ } )
10431046 }
10441047}
10451048
Original file line number Diff line number Diff line change @@ -829,7 +829,10 @@ impl LengthReadable for Refund {
829829 reader : & mut R ,
830830 ) -> Result < Self , DecodeError > {
831831 let bytes: WithoutLength < Vec < u8 > > = LengthReadable :: read_from_fixed_length_buffer ( reader) ?;
832- Self :: try_from ( bytes. 0 ) . map_err ( |_| DecodeError :: InvalidValue )
832+ Self :: try_from ( bytes. 0 ) . map_err ( |e| match e {
833+ Bolt12ParseError :: Decode ( e) => e,
834+ _ => DecodeError :: InvalidValue ,
835+ } )
833836 }
834837}
835838
You can’t perform that action at this time.
0 commit comments