File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ pub enum Error {
14
14
/// Payment of the given invoice has already been intiated.
15
15
NonUniquePaymentHash ,
16
16
/// The given invoice is invalid.
17
- InvoiceInvalid ,
17
+ InvalidInvoice ,
18
18
/// Invoice creation failed.
19
19
InvoiceCreationFailed ,
20
20
/// There are insufficient funds to complete the given operation.
21
- FundsInsufficient ,
21
+ InsufficientFunds ,
22
22
/// An attempted payment has failed.
23
23
PaymentFailed ,
24
24
/// A given peer info could not be parsed.
@@ -47,9 +47,9 @@ impl fmt::Display for Error {
47
47
}
48
48
Self :: ConnectionFailed => write ! ( f, "Network connection closed." ) ,
49
49
Self :: NonUniquePaymentHash => write ! ( f, "An invoice must not get payed twice." ) ,
50
- Self :: InvoiceInvalid => write ! ( f, "The given invoice is invalid." ) ,
50
+ Self :: InvalidInvoice => write ! ( f, "The given invoice is invalid." ) ,
51
51
Self :: InvoiceCreationFailed => write ! ( f, "Failed to create invoice." ) ,
52
- Self :: FundsInsufficient => {
52
+ Self :: InsufficientFunds => {
53
53
write ! ( f, "There are insufficient funds to complete the given operation." )
54
54
}
55
55
Self :: PaymentFailed => write ! ( f, "Failed to send the given payment." ) ,
Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ impl Node {
720
720
let cur_balance = self . wallet . get_balance ( ) ?;
721
721
if cur_balance. get_spendable ( ) < channel_amount_sats {
722
722
log_error ! ( self . logger, "Unable to create channel due to insufficient funds." ) ;
723
- return Err ( Error :: FundsInsufficient ) ;
723
+ return Err ( Error :: InsufficientFunds ) ;
724
724
}
725
725
726
726
let peer_info = PeerInfo :: try_from ( node_pubkey_and_address. to_string ( ) ) ?;
@@ -868,7 +868,7 @@ impl Node {
868
868
}
869
869
Err ( payment:: PaymentError :: Invoice ( e) ) => {
870
870
log_error ! ( self . logger, "Failed to send payment due to invalid invoice: {}" , e) ;
871
- Err ( Error :: InvoiceInvalid )
871
+ Err ( Error :: InvalidInvoice )
872
872
}
873
873
Err ( payment:: PaymentError :: Sending ( e) ) => {
874
874
log_error ! ( self . logger, "Failed to send payment: {:?}" , e) ;
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ fn channel_open_fails_when_funds_insufficient() {
226
226
let node_b_addr =
227
227
format ! ( "{}@{}" , node_b. node_id( ) . unwrap( ) , node_b. listening_address( ) . unwrap( ) ) ;
228
228
assert_eq ! (
229
- Err ( Error :: FundsInsufficient ) ,
229
+ Err ( Error :: InsufficientFunds ) ,
230
230
node_a. connect_open_channel( & node_b_addr, 120000 , true )
231
231
) ;
232
232
}
You can’t perform that action at this time.
0 commit comments