|
63 | 63 | //! # ) -> Result<(), PaymentSendFailure> { unimplemented!() }
|
64 | 64 | //! # }
|
65 | 65 | //! #
|
66 |
| -//! # struct FakeRouter {}; |
| 66 | +//! # struct FakeRouter {} |
67 | 67 | //! # impl<S: Score> Router<S> for FakeRouter {
|
68 | 68 | //! # fn find_route(
|
69 | 69 | //! # &self, payer: &PublicKey, params: &RouteParameters, payment_hash: &PaymentHash,
|
70 | 70 | //! # first_hops: Option<&[&ChannelDetails]>, scorer: &S
|
71 | 71 | //! # ) -> Result<Route, LightningError> { unimplemented!() }
|
72 | 72 | //! # }
|
73 | 73 | //! #
|
74 |
| -//! # struct FakeScorer {}; |
| 74 | +//! # struct FakeScorer {} |
75 | 75 | //! # impl Writeable for FakeScorer {
|
76 | 76 | //! # fn write<W: Writer>(&self, w: &mut W) -> Result<(), std::io::Error> { unimplemented!(); }
|
77 | 77 | //! # }
|
|
82 | 82 | //! # fn payment_path_failed(&mut self, _path: &[&RouteHop], _short_channel_id: u64) {}
|
83 | 83 | //! # }
|
84 | 84 | //! #
|
85 |
| -//! # struct FakeLogger {}; |
| 85 | +//! # struct FakeLogger {} |
86 | 86 | //! # impl Logger for FakeLogger {
|
87 | 87 | //! # fn log(&self, record: &Record) { unimplemented!() }
|
88 | 88 | //! # }
|
|
102 | 102 | //! let invoice_payer = InvoicePayer::new(&payer, router, &scorer, &logger, event_handler, RetryAttempts(2));
|
103 | 103 | //!
|
104 | 104 | //! let invoice = "...";
|
105 |
| -//! let invoice = invoice.parse::<Invoice>().unwrap(); |
106 |
| -//! invoice_payer.pay_invoice(&invoice).unwrap(); |
| 105 | +//! if let Ok(invoice) = invoice.parse::<Invoice>() { |
| 106 | +//! invoice_payer.pay_invoice(&invoice).unwrap(); |
107 | 107 | //!
|
108 | 108 | //! # let event_provider = FakeEventProvider {};
|
109 |
| -//! loop { |
110 |
| -//! event_provider.process_pending_events(&invoice_payer); |
| 109 | +//! loop { |
| 110 | +//! event_provider.process_pending_events(&invoice_payer); |
| 111 | +//! } |
111 | 112 | //! }
|
112 | 113 | //! # }
|
113 | 114 | //! ```
|
|
0 commit comments