@@ -327,7 +327,7 @@ pub enum TaggedField {
327327 ExpiryTime ( ExpiryTime ) ,
328328 MinFinalCltvExpiry ( MinFinalCltvExpiry ) ,
329329 Fallback ( Fallback ) ,
330- Route ( Route ) ,
330+ Route ( RouteHint ) ,
331331 PaymentSecret ( PaymentSecret ) ,
332332}
333333
@@ -387,7 +387,7 @@ pub struct Signature(pub RecoverableSignature);
387387/// The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
388388///
389389#[ derive( Eq , PartialEq , Debug , Clone ) ]
390- pub struct Route ( Vec < RouteHintHop > ) ;
390+ pub struct RouteHint ( Vec < RouteHintHop > ) ;
391391
392392/// Tag constants as specified in BOLT11
393393#[ allow( missing_docs) ]
@@ -485,7 +485,7 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool> InvoiceBuilder<D, H, T> {
485485
486486 /// Adds a private route.
487487 pub fn route ( mut self , route : Vec < RouteHintHop > ) -> Self {
488- match Route :: new ( route) {
488+ match RouteHint :: new ( route) {
489489 Ok ( r) => self . tagged_fields . push ( TaggedField :: Route ( r) ) ,
490490 Err ( e) => self . error = Some ( e) ,
491491 }
@@ -817,11 +817,11 @@ impl RawInvoice {
817817 } ) . collect :: < Vec < & Fallback > > ( )
818818 }
819819
820- pub fn routes ( & self ) -> Vec < & Route > {
820+ pub fn routes ( & self ) -> Vec < & RouteHint > {
821821 self . known_tagged_fields ( ) . filter_map ( |tf| match tf {
822822 & TaggedField :: Route ( ref r) => Some ( r) ,
823823 _ => None ,
824- } ) . collect :: < Vec < & Route > > ( )
824+ } ) . collect :: < Vec < & RouteHint > > ( )
825825 }
826826
827827 pub fn amount_pico_btc ( & self ) -> Option < u64 > {
@@ -1020,7 +1020,7 @@ impl Invoice {
10201020 }
10211021
10221022 /// Returns a list of all routes included in the invoice
1023- pub fn routes ( & self ) -> Vec < & Route > {
1023+ pub fn routes ( & self ) -> Vec < & RouteHint > {
10241024 self . signed_invoice . routes ( )
10251025 }
10261026
@@ -1142,11 +1142,11 @@ impl ExpiryTime {
11421142 }
11431143}
11441144
1145- impl Route {
1145+ impl RouteHint {
11461146 /// Create a new (partial) route from a list of hops
1147- pub fn new ( hops : Vec < RouteHintHop > ) -> Result < Route , CreationError > {
1147+ pub fn new ( hops : Vec < RouteHintHop > ) -> Result < RouteHint , CreationError > {
11481148 if hops. len ( ) <= 12 {
1149- Ok ( Route ( hops) )
1149+ Ok ( RouteHint ( hops) )
11501150 } else {
11511151 Err ( CreationError :: RouteTooLong )
11521152 }
@@ -1158,13 +1158,13 @@ impl Route {
11581158 }
11591159}
11601160
1161- impl Into < Vec < RouteHintHop > > for Route {
1161+ impl Into < Vec < RouteHintHop > > for RouteHint {
11621162 fn into ( self ) -> Vec < RouteHintHop > {
11631163 self . into_inner ( )
11641164 }
11651165}
11661166
1167- impl Deref for Route {
1167+ impl Deref for RouteHint {
11681168 type Target = Vec < RouteHintHop > ;
11691169
11701170 fn deref ( & self ) -> & Vec < RouteHintHop > {
@@ -1573,7 +1573,7 @@ mod test {
15731573 assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( 54321 ) ) ;
15741574 assert_eq ! ( invoice. min_final_cltv_expiry( ) , Some ( & 144 ) ) ;
15751575 assert_eq ! ( invoice. fallbacks( ) , vec![ & Fallback :: PubKeyHash ( [ 0 ; 20 ] ) ] ) ;
1576- assert_eq ! ( invoice. routes( ) , vec![ & Route ( route_1) , & Route ( route_2) ] ) ;
1576+ assert_eq ! ( invoice. routes( ) , vec![ & RouteHint ( route_1) , & RouteHint ( route_2) ] ) ;
15771577 assert_eq ! (
15781578 invoice. description( ) ,
15791579 InvoiceDescription :: Hash ( & Sha256 ( sha256:: Hash :: from_slice( & [ 3 ; 32 ] [ ..] ) . unwrap( ) ) )
0 commit comments