light client RPC dependencies

This commit is contained in:
Robert Habermeier
2017-03-22 21:09:43 +01:00
parent 35d9a9815e
commit 73b2dd7a59
7 changed files with 175 additions and 5 deletions

View File

@@ -642,6 +642,9 @@ pub trait LightSyncProvider {
/// Get peers information
fn peers(&self) -> Vec<PeerInfo>;
/// Get network id.
fn network_id(&self) -> u64;
/// Get the enode if available.
fn enode(&self) -> Option<String>;
@@ -666,6 +669,7 @@ pub struct LightSync {
proto: Arc<LightProtocol>,
network: NetworkService,
subprotocol_name: [u8; 3],
network_id: u64,
}
impl LightSync {
@@ -701,6 +705,7 @@ impl LightSync {
proto: light_proto,
network: service,
subprotocol_name: params.subprotocol_name,
network_id: params.network_id,
})
}
@@ -796,6 +801,10 @@ impl LightSyncProvider for LightSync {
self.network.external_url()
}
fn network_id(&self) -> u64 {
self.network_id
}
fn transactions_stats(&self) -> BTreeMap<H256, TransactionStats> {
Default::default() // TODO
}