Bump LDK to 0.0.121/rust-bitcoin 0.30, bumping MSRV to 1.63
[rapid-gossip-sync-server] / src / types.rs
index 3e3d8c3317a2d622dd344dbab133449d05c54d62..0c6c9b2533a7404c556e4e3a15bfa673bd178bc5 100644 (file)
@@ -14,8 +14,9 @@ pub(crate) type GossipPeerManager<L> = Arc<PeerManager<lightning_net_tokio::Sock
 
 #[derive(Debug)]
 pub(crate) enum GossipMessage {
-       ChannelAnnouncement(ChannelAnnouncement),
-       ChannelUpdate(ChannelUpdate),
+       // the second element is an optional override for the seen value
+       ChannelAnnouncement(ChannelAnnouncement, Option<u32>),
+       ChannelUpdate(ChannelUpdate, Option<u32>),
 }
 
 #[derive(Clone, Copy)]
@@ -28,7 +29,7 @@ impl RGSSLogger {
 }
 
 impl Logger for RGSSLogger {
-       fn log(&self, record: &Record) {
+       fn log(&self, record: Record) {
                let threshold = config::log_level();
                if record.level < threshold {
                        return;
@@ -51,7 +52,8 @@ pub mod tests {
 
        impl TestLogger {
                pub fn new() -> TestLogger {
-                       Self::with_id("".to_owned())
+                       let id = crate::tests::db_test_schema();
+                       Self::with_id(id)
                }
                pub fn with_id(id: String) -> TestLogger {
                        TestLogger {
@@ -82,7 +84,7 @@ pub mod tests {
        }
 
        impl Logger for TestLogger {
-               fn log(&self, record: &Record) {
+               fn log(&self, record: Record) {
                        *self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1;
                        println!("{:<5} {} [{} : {}, {}] {}", record.level.to_string(), self.id, record.module_path, record.file, record.line, record.args);
                }