mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
chore: add capabilities to NetworkStatus (#17236)
This commit is contained in:
@@ -35,7 +35,8 @@ pub use events::{
|
||||
};
|
||||
|
||||
use reth_eth_wire_types::{
|
||||
capability::Capabilities, DisconnectReason, EthVersion, NetworkPrimitives, UnifiedStatus,
|
||||
capability::Capabilities, Capability, DisconnectReason, EthVersion, NetworkPrimitives,
|
||||
UnifiedStatus,
|
||||
};
|
||||
use reth_network_p2p::sync::NetworkSyncUpdater;
|
||||
use reth_network_peers::NodeRecord;
|
||||
@@ -285,4 +286,6 @@ pub struct NetworkStatus {
|
||||
pub protocol_version: u64,
|
||||
/// Information about the Ethereum Wire Protocol.
|
||||
pub eth_protocol_info: EthProtocolInfo,
|
||||
/// The list of supported capabilities and their versions.
|
||||
pub capabilities: Vec<Capability>,
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ where
|
||||
config: Default::default(),
|
||||
head: Default::default(),
|
||||
},
|
||||
capabilities: vec![],
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +457,11 @@ impl<N: NetworkPrimitives> NetworkManager<N> {
|
||||
genesis: status.genesis,
|
||||
config: Default::default(),
|
||||
},
|
||||
capabilities: hello_message
|
||||
.protocols
|
||||
.into_iter()
|
||||
.map(|protocol| protocol.cap)
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ mod tests {
|
||||
config: Default::default(),
|
||||
head: Default::default(),
|
||||
},
|
||||
capabilities: vec![],
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user