struct TestAsyncPaymentsMessageHandler {}
impl AsyncPaymentsMessageHandler for TestAsyncPaymentsMessageHandler {
- fn held_htlc_available(
+ fn handle_held_htlc_available(
&self, _message: HeldHtlcAvailable, responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)> {
let responder = match responder {
};
Some((ReleaseHeldHtlc {}, responder.respond()))
}
- fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
+ fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
}
#[derive(Debug)]
MR::Target: MessageRouter,
L::Target: Logger,
{
- fn held_htlc_available(
+ fn handle_held_htlc_available(
&self, _message: HeldHtlcAvailable, _responder: Option<Responder>
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)> {
None
}
- fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {
+ fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {
#[cfg(async_payments)] {
let AsyncPaymentsContext::OutboundPayment { payment_id, hmac, nonce } = _context;
if payment_id.verify_for_async_payment(hmac, nonce, &self.inbound_payment_key).is_err() { return }
}
}
impl AsyncPaymentsMessageHandler for IgnoringMessageHandler {
- fn held_htlc_available(
+ fn handle_held_htlc_available(
&self, _message: HeldHtlcAvailable, _responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)> {
None
}
- fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
+ fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
}
impl DNSResolverMessageHandler for IgnoringMessageHandler {
fn handle_dnssec_query(
pub trait AsyncPaymentsMessageHandler {
/// Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release
/// the held funds.
- fn held_htlc_available(
+ fn handle_held_htlc_available(
&self, message: HeldHtlcAvailable, responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)>;
/// Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC
/// should be released to the corresponding payee.
- fn release_held_htlc(&self, message: ReleaseHeldHtlc, context: AsyncPaymentsContext);
+ fn handle_release_held_htlc(&self, message: ReleaseHeldHtlc, context: AsyncPaymentsContext);
/// Release any [`AsyncPaymentsMessage`]s that need to be sent.
///
struct TestAsyncPaymentsMessageHandler {}
impl AsyncPaymentsMessageHandler for TestAsyncPaymentsMessageHandler {
- fn held_htlc_available(
+ fn handle_held_htlc_available(
&self, _message: HeldHtlcAvailable, _responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)> {
None
}
- fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
+ fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
}
struct TestDNSResolverMessageHandler {}
},
#[cfg(async_payments)]
ParsedOnionMessageContents::AsyncPayments(AsyncPaymentsMessage::HeldHtlcAvailable(msg)) => {
- let response_instructions = self.async_payments_handler.held_htlc_available(
+ let response_instructions = self.async_payments_handler.handle_held_htlc_available(
msg, responder
);
if let Some((msg, instructions)) = response_instructions {
},
None => return,
};
- self.async_payments_handler.release_held_htlc(msg, context);
+ self.async_payments_handler.handle_release_held_htlc(msg, context);
},
ParsedOnionMessageContents::DNSResolver(DNSResolverMessage::DNSSECQuery(msg)) => {
let response_instructions = self.dns_resolver_handler.handle_dnssec_query(msg, responder);