Removes obsolete is_valid_node_url()
This commit is contained in:
parent
1516fc1c57
commit
851401dded
@ -73,7 +73,7 @@ mod api;
|
|||||||
|
|
||||||
pub use api::*;
|
pub use api::*;
|
||||||
pub use chain::{SyncStatus, SyncState};
|
pub use chain::{SyncStatus, SyncState};
|
||||||
pub use network::{is_valid_node_url, validate_node_url, NonReservedPeerMode, NetworkError, ConnectionFilter, ConnectionDirection};
|
pub use network::{validate_node_url, NonReservedPeerMode, NetworkError, ConnectionFilter, ConnectionDirection};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub(crate) type Address = bigint::hash::H160;
|
pub(crate) type Address = bigint::hash::H160;
|
||||||
|
@ -115,7 +115,7 @@ pub use session::SessionInfo;
|
|||||||
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
|
pub use connection_filter::{ConnectionFilter, ConnectionDirection};
|
||||||
|
|
||||||
pub use io::TimerToken;
|
pub use io::TimerToken;
|
||||||
pub use node_table::{is_valid_node_url, validate_node_url, NodeId};
|
pub use node_table::{validate_node_url, NodeId};
|
||||||
use ipnetwork::{IpNetwork, IpNetworkError};
|
use ipnetwork::{IpNetwork, IpNetworkError};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
@ -363,12 +363,6 @@ impl Drop for NodeTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Check if node url is valid
|
/// Check if node url is valid
|
||||||
pub fn is_valid_node_url(url: &str) -> bool {
|
|
||||||
use std::str::FromStr;
|
|
||||||
Node::from_str(url).is_ok()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Same as `is_valid_node_url` but returns detailed `NetworkError`
|
|
||||||
pub fn validate_node_url(url: &str) -> Option<NetworkError> {
|
pub fn validate_node_url(url: &str) -> Option<NetworkError> {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
match Node::from_str(url) {
|
match Node::from_str(url) {
|
||||||
@ -399,7 +393,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn node_parse() {
|
fn node_parse() {
|
||||||
assert!(is_valid_node_url("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770"));
|
assert!(validate_node_url("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770").is_some());
|
||||||
let node = Node::from_str("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770");
|
let node = Node::from_str("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@22.99.55.44:7770");
|
||||||
assert!(node.is_ok());
|
assert!(node.is_ok());
|
||||||
let node = node.unwrap();
|
let node = node.unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user