Skip to content

Commit 1416dbf

Browse files
committed
add missing documentation (which, for some reason, didn't trigger a build failure locally)
1 parent b0c0450 commit 1416dbf

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

lightning-graph-sync/src/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
use lightning::ln::msgs::{DecodeError, LightningError};
22

3+
/// All-encompassing standard error type that processing can return
34
pub enum GraphSyncError {
5+
/// IO error wrapper, typically the result of an issue with the file system
46
IOError(std::io::Error),
7+
/// Error trying to read the update data, typically due to an erroneous data length indication
8+
/// that is greater than the actual amount of data provided
59
DecodeError(DecodeError),
10+
/// Error applying the patch to the network graph, usually the result of updates that are too
11+
/// old or missing prerequisite data to the application of updates out of order
612
LightningError(LightningError),
13+
/// Some other error whose nature is indicated in its descriptor string
714
ProcessingError(String),
815
}
916

lightning-graph-sync/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,27 @@
88
#![deny(unused_variables)]
99
#![deny(unused_imports)]
1010

11+
//! This crate exposes functionality to rapidly sync gossip data, aimed primarily at mobile
12+
//! devices.
13+
1114
use std::fs::File;
1215

1316
use lightning::routing::network_graph;
1417

1518
use crate::error::GraphSyncError;
1619

20+
/// Error types that these functions can return
1721
pub mod error;
22+
23+
/// Core functionality of this crate
1824
pub mod processing;
1925

26+
/// Sync gossip data from a file
27+
///
28+
/// `network_graph`: The network graph to apply the updates to
29+
///
30+
/// `sync_path`: Path to the file where the gossip update data is located
31+
///
2032
pub fn sync_network_graph_with_file_path(
2133
network_graph: &network_graph::NetworkGraph,
2234
sync_path: &str,

lightning-graph-sync/src/processing.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ use crate::error::GraphSyncError;
1919
/// data receipt, as opposed to originally signed value. TODO: TBD
2020
const TIMESTAMP_RETROGRESSION_DELTA: u32 = 7 * 24 * 3600;
2121

22+
/// Update network graph from binary data
23+
///
24+
/// `network_graph`: network graph to be updated
25+
///
26+
/// `update_data`: `&[u8]` binary stream that comprises the update data
2227
pub fn update_network_graph(
2328
network_graph: &network_graph::NetworkGraph,
2429
update_data: &[u8],

0 commit comments

Comments
 (0)