pub struct TestChannelMessageHandler {
pub pending_events: Mutex<Vec<MessageSendEvent>>,
pub message_fetch_counter: AtomicUsize,
/* private fields */
}
Fields§
§pending_events: Mutex<Vec<MessageSendEvent>>
§message_fetch_counter: AtomicUsize
Implementations§
§impl TestChannelMessageHandler
impl TestChannelMessageHandler
pub fn new(chain_hash: ChainHash) -> TestChannelMessageHandler
Trait Implementations§
§impl ChannelMessageHandler for TestChannelMessageHandler
impl ChannelMessageHandler for TestChannelMessageHandler
§fn handle_open_channel(&self, _their_node_id: &PublicKey, msg: &OpenChannel)
fn handle_open_channel(&self, _their_node_id: &PublicKey, msg: &OpenChannel)
Handle an incoming
open_channel
message from the given peer.§fn handle_accept_channel(&self, _their_node_id: &PublicKey, msg: &AcceptChannel)
fn handle_accept_channel(&self, _their_node_id: &PublicKey, msg: &AcceptChannel)
Handle an incoming
accept_channel
message from the given peer.§fn handle_funding_created(
&self,
_their_node_id: &PublicKey,
msg: &FundingCreated,
)
fn handle_funding_created( &self, _their_node_id: &PublicKey, msg: &FundingCreated, )
Handle an incoming
funding_created
message from the given peer.§fn handle_funding_signed(&self, _their_node_id: &PublicKey, msg: &FundingSigned)
fn handle_funding_signed(&self, _their_node_id: &PublicKey, msg: &FundingSigned)
Handle an incoming
funding_signed
message from the given peer.§fn handle_channel_ready(&self, _their_node_id: &PublicKey, msg: &ChannelReady)
fn handle_channel_ready(&self, _their_node_id: &PublicKey, msg: &ChannelReady)
Handle an incoming
channel_ready
message from the given peer.§fn handle_shutdown(&self, _their_node_id: &PublicKey, msg: &Shutdown)
fn handle_shutdown(&self, _their_node_id: &PublicKey, msg: &Shutdown)
Handle an incoming
shutdown
message from the given peer.§fn handle_closing_signed(&self, _their_node_id: &PublicKey, msg: &ClosingSigned)
fn handle_closing_signed(&self, _their_node_id: &PublicKey, msg: &ClosingSigned)
Handle an incoming
closing_signed
message from the given peer.§fn handle_update_add_htlc(
&self,
_their_node_id: &PublicKey,
msg: &UpdateAddHTLC,
)
fn handle_update_add_htlc( &self, _their_node_id: &PublicKey, msg: &UpdateAddHTLC, )
Handle an incoming
update_add_htlc
message from the given peer.§fn handle_update_fulfill_htlc(
&self,
_their_node_id: &PublicKey,
msg: &UpdateFulfillHTLC,
)
fn handle_update_fulfill_htlc( &self, _their_node_id: &PublicKey, msg: &UpdateFulfillHTLC, )
Handle an incoming
update_fulfill_htlc
message from the given peer.§fn handle_update_fail_htlc(
&self,
_their_node_id: &PublicKey,
msg: &UpdateFailHTLC,
)
fn handle_update_fail_htlc( &self, _their_node_id: &PublicKey, msg: &UpdateFailHTLC, )
Handle an incoming
update_fail_htlc
message from the given peer.§fn handle_update_fail_malformed_htlc(
&self,
_their_node_id: &PublicKey,
msg: &UpdateFailMalformedHTLC,
)
fn handle_update_fail_malformed_htlc( &self, _their_node_id: &PublicKey, msg: &UpdateFailMalformedHTLC, )
Handle an incoming
update_fail_malformed_htlc
message from the given peer.§fn handle_commitment_signed(
&self,
_their_node_id: &PublicKey,
msg: &CommitmentSigned,
)
fn handle_commitment_signed( &self, _their_node_id: &PublicKey, msg: &CommitmentSigned, )
Handle an incoming
commitment_signed
message from the given peer.§fn handle_revoke_and_ack(&self, _their_node_id: &PublicKey, msg: &RevokeAndACK)
fn handle_revoke_and_ack(&self, _their_node_id: &PublicKey, msg: &RevokeAndACK)
Handle an incoming
revoke_and_ack
message from the given peer.§fn handle_update_fee(&self, _their_node_id: &PublicKey, msg: &UpdateFee)
fn handle_update_fee(&self, _their_node_id: &PublicKey, msg: &UpdateFee)
Handle an incoming
update_fee
message from the given peer.§fn handle_channel_update(
&self,
_their_node_id: &PublicKey,
_msg: &ChannelUpdate,
)
fn handle_channel_update( &self, _their_node_id: &PublicKey, _msg: &ChannelUpdate, )
Handle an incoming
channel_update
message from the given peer.§fn handle_announcement_signatures(
&self,
_their_node_id: &PublicKey,
msg: &AnnouncementSignatures,
)
fn handle_announcement_signatures( &self, _their_node_id: &PublicKey, msg: &AnnouncementSignatures, )
Handle an incoming
announcement_signatures
message from the given peer.§fn handle_channel_reestablish(
&self,
_their_node_id: &PublicKey,
msg: &ChannelReestablish,
)
fn handle_channel_reestablish( &self, _their_node_id: &PublicKey, msg: &ChannelReestablish, )
Handle an incoming
channel_reestablish
message from the given peer.§fn peer_disconnected(&self, their_node_id: &PublicKey)
fn peer_disconnected(&self, their_node_id: &PublicKey)
Indicates a connection to the peer failed/an existing connection was lost.
§fn peer_connected(
&self,
their_node_id: &PublicKey,
_msg: &Init,
_inbound: bool,
) -> Result<(), ()>
fn peer_connected( &self, their_node_id: &PublicKey, _msg: &Init, _inbound: bool, ) -> Result<(), ()>
Handle a peer reconnecting, possibly generating
channel_reestablish
message(s). Read more§fn handle_error(&self, _their_node_id: &PublicKey, msg: &ErrorMessage)
fn handle_error(&self, _their_node_id: &PublicKey, msg: &ErrorMessage)
Handle an incoming
error
message from the given peer.§fn provided_node_features(&self) -> Features<NodeContext>
fn provided_node_features(&self) -> Features<NodeContext>
Gets the node feature flags which this handler itself supports. All available handlers are
queried similarly and their feature flags are OR’d together to form the
NodeFeatures
which are broadcasted in our NodeAnnouncement
message.§fn provided_init_features(
&self,
_their_init_features: &PublicKey,
) -> Features<InitContext>
fn provided_init_features( &self, _their_init_features: &PublicKey, ) -> Features<InitContext>
Gets the init feature flags which should be sent to the given peer. All available handlers
are queried similarly and their feature flags are OR’d together to form the
InitFeatures
which are sent in our Init
message. Read more§fn get_chain_hashes(&self) -> Option<Vec<ChainHash>>
fn get_chain_hashes(&self) -> Option<Vec<ChainHash>>
Gets the chain hashes for this
ChannelMessageHandler
indicating which chains it supports. Read more§fn handle_open_channel_v2(
&self,
_their_node_id: &PublicKey,
msg: &OpenChannelV2,
)
fn handle_open_channel_v2( &self, _their_node_id: &PublicKey, msg: &OpenChannelV2, )
Handle an incoming
open_channel2
message from the given peer.§fn handle_accept_channel_v2(
&self,
_their_node_id: &PublicKey,
msg: &AcceptChannelV2,
)
fn handle_accept_channel_v2( &self, _their_node_id: &PublicKey, msg: &AcceptChannelV2, )
Handle an incoming
accept_channel2
message from the given peer.§fn handle_tx_add_input(&self, _their_node_id: &PublicKey, msg: &TxAddInput)
fn handle_tx_add_input(&self, _their_node_id: &PublicKey, msg: &TxAddInput)
Handle an incoming
tx_add_input message
from the given peer.§fn handle_tx_add_output(&self, _their_node_id: &PublicKey, msg: &TxAddOutput)
fn handle_tx_add_output(&self, _their_node_id: &PublicKey, msg: &TxAddOutput)
Handle an incoming
tx_add_output
message from the given peer.§fn handle_tx_remove_input(
&self,
_their_node_id: &PublicKey,
msg: &TxRemoveInput,
)
fn handle_tx_remove_input( &self, _their_node_id: &PublicKey, msg: &TxRemoveInput, )
Handle an incoming
tx_remove_input
message from the given peer.§fn handle_tx_remove_output(
&self,
_their_node_id: &PublicKey,
msg: &TxRemoveOutput,
)
fn handle_tx_remove_output( &self, _their_node_id: &PublicKey, msg: &TxRemoveOutput, )
Handle an incoming
tx_remove_output
message from the given peer.§fn handle_tx_complete(&self, _their_node_id: &PublicKey, msg: &TxComplete)
fn handle_tx_complete(&self, _their_node_id: &PublicKey, msg: &TxComplete)
Handle an incoming
tx_complete message
from the given peer.§fn handle_tx_signatures(&self, _their_node_id: &PublicKey, msg: &TxSignatures)
fn handle_tx_signatures(&self, _their_node_id: &PublicKey, msg: &TxSignatures)
Handle an incoming
tx_signatures
message from the given peer.§fn handle_tx_init_rbf(&self, _their_node_id: &PublicKey, msg: &TxInitRbf)
fn handle_tx_init_rbf(&self, _their_node_id: &PublicKey, msg: &TxInitRbf)
Handle an incoming
tx_init_rbf
message from the given peer.§fn handle_tx_ack_rbf(&self, _their_node_id: &PublicKey, msg: &TxAckRbf)
fn handle_tx_ack_rbf(&self, _their_node_id: &PublicKey, msg: &TxAckRbf)
Handle an incoming
tx_ack_rbf
message from the given peer.§fn handle_tx_abort(&self, _their_node_id: &PublicKey, msg: &TxAbort)
fn handle_tx_abort(&self, _their_node_id: &PublicKey, msg: &TxAbort)
Handle an incoming
tx_abort message
from the given peer.§impl Drop for TestChannelMessageHandler
impl Drop for TestChannelMessageHandler
§impl MessageSendEventsProvider for TestChannelMessageHandler
impl MessageSendEventsProvider for TestChannelMessageHandler
§fn get_and_clear_pending_msg_events(&self) -> Vec<MessageSendEvent>
fn get_and_clear_pending_msg_events(&self) -> Vec<MessageSendEvent>
Gets the list of pending events which were generated by previous actions, clearing the list
in the process.
Auto Trait Implementations§
impl !Freeze for TestChannelMessageHandler
impl RefUnwindSafe for TestChannelMessageHandler
impl Send for TestChannelMessageHandler
impl Sync for TestChannelMessageHandler
impl Unpin for TestChannelMessageHandler
impl UnwindSafe for TestChannelMessageHandler
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request