use ln::msgs;
use bitcoin::blockdata::script::Script;
use bitcoin::util::uint::Uint256;
use bitcoin::util::hash::Sha256dHash;
use secp256k1::key::PublicKey;
use std::time::Instant;
pub enum Event {
FundingGenerationReady {
temporary_channel_id: Uint256,
channel_value_satoshis: u64,
output_script: Script,
user_channel_id: u64,
},
FundingBroadcastSafe {
funding_txo: (Sha256dHash, u16),
user_channel_id: u64,
},
PaymentReceived {
payment_hash: [u8; 32],
amt: u64,
},
PendingHTLCsForwardable {
time_forwardable: Instant,
},
SendFundingCreated {
node_id: PublicKey,
msg: msgs::FundingCreated,
},
SendFundingLocked {
node_id: PublicKey,
msg: msgs::FundingLocked,
announcement_sigs: Option<msgs::AnnouncementSignatures>,
},
SendHTLCs {
node_id: PublicKey,
msgs: Vec<msgs::UpdateAddHTLC>,
commitment_msg: msgs::CommitmentSigned,
},
SendFulfillHTLC {
node_id: PublicKey,
msg: msgs::UpdateFulfillHTLC,
},
BroadcastChannelAnnouncement {
msg: msgs::ChannelAnnouncement,
update_msg: msgs::ChannelUpdate,
},
}
pub trait EventsProvider {
fn get_and_clear_pending_events(&self) -> Vec<Event>;
}