@@ -327,7 +327,7 @@ pub enum TaggedField {
327
327
ExpiryTime ( ExpiryTime ) ,
328
328
MinFinalCltvExpiry ( MinFinalCltvExpiry ) ,
329
329
Fallback ( Fallback ) ,
330
- Route ( Route ) ,
330
+ Route ( RouteHint ) ,
331
331
PaymentSecret ( PaymentSecret ) ,
332
332
}
333
333
@@ -387,7 +387,7 @@ pub struct Signature(pub RecoverableSignature);
387
387
/// The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
388
388
///
389
389
#[ derive( Eq , PartialEq , Debug , Clone ) ]
390
- pub struct Route ( Vec < RouteHintHop > ) ;
390
+ pub struct RouteHint ( Vec < RouteHintHop > ) ;
391
391
392
392
/// Tag constants as specified in BOLT11
393
393
#[ allow( missing_docs) ]
@@ -485,7 +485,7 @@ impl<D: tb::Bool, H: tb::Bool, T: tb::Bool> InvoiceBuilder<D, H, T> {
485
485
486
486
/// Adds a private route.
487
487
pub fn route ( mut self , route : Vec < RouteHintHop > ) -> Self {
488
- match Route :: new ( route) {
488
+ match RouteHint :: new ( route) {
489
489
Ok ( r) => self . tagged_fields . push ( TaggedField :: Route ( r) ) ,
490
490
Err ( e) => self . error = Some ( e) ,
491
491
}
@@ -817,11 +817,11 @@ impl RawInvoice {
817
817
} ) . collect :: < Vec < & Fallback > > ( )
818
818
}
819
819
820
- pub fn routes ( & self ) -> Vec < & Route > {
820
+ pub fn routes ( & self ) -> Vec < & RouteHint > {
821
821
self . known_tagged_fields ( ) . filter_map ( |tf| match tf {
822
822
& TaggedField :: Route ( ref r) => Some ( r) ,
823
823
_ => None ,
824
- } ) . collect :: < Vec < & Route > > ( )
824
+ } ) . collect :: < Vec < & RouteHint > > ( )
825
825
}
826
826
827
827
pub fn amount_pico_btc ( & self ) -> Option < u64 > {
@@ -1020,7 +1020,7 @@ impl Invoice {
1020
1020
}
1021
1021
1022
1022
/// Returns a list of all routes included in the invoice
1023
- pub fn routes ( & self ) -> Vec < & Route > {
1023
+ pub fn routes ( & self ) -> Vec < & RouteHint > {
1024
1024
self . signed_invoice . routes ( )
1025
1025
}
1026
1026
@@ -1142,11 +1142,11 @@ impl ExpiryTime {
1142
1142
}
1143
1143
}
1144
1144
1145
- impl Route {
1145
+ impl RouteHint {
1146
1146
/// 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 > {
1148
1148
if hops. len ( ) <= 12 {
1149
- Ok ( Route ( hops) )
1149
+ Ok ( RouteHint ( hops) )
1150
1150
} else {
1151
1151
Err ( CreationError :: RouteTooLong )
1152
1152
}
@@ -1158,13 +1158,13 @@ impl Route {
1158
1158
}
1159
1159
}
1160
1160
1161
- impl Into < Vec < RouteHintHop > > for Route {
1161
+ impl Into < Vec < RouteHintHop > > for RouteHint {
1162
1162
fn into ( self ) -> Vec < RouteHintHop > {
1163
1163
self . into_inner ( )
1164
1164
}
1165
1165
}
1166
1166
1167
- impl Deref for Route {
1167
+ impl Deref for RouteHint {
1168
1168
type Target = Vec < RouteHintHop > ;
1169
1169
1170
1170
fn deref ( & self ) -> & Vec < RouteHintHop > {
@@ -1573,7 +1573,7 @@ mod test {
1573
1573
assert_eq ! ( invoice. expiry_time( ) , Duration :: from_secs( 54321 ) ) ;
1574
1574
assert_eq ! ( invoice. min_final_cltv_expiry( ) , Some ( & 144 ) ) ;
1575
1575
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) ] ) ;
1577
1577
assert_eq ! (
1578
1578
invoice. description( ) ,
1579
1579
InvoiceDescription :: Hash ( & Sha256 ( sha256:: Hash :: from_slice( & [ 3 ; 32 ] [ ..] ) . unwrap( ) ) )
0 commit comments