Skip to content

Commit

Permalink
[network] move ChainId to Libra types
Browse files Browse the repository at this point in the history
Closes: #4969
Approved by: aching
  • Loading branch information
Christina Lee authored and bors-libra committed Jul 15, 2020
1 parent 5630258 commit b0615b8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/src/config/mod.rs
Expand Up @@ -44,9 +44,9 @@ pub use safety_rules_config::*;
mod upstream_config;
pub use upstream_config::*;
mod test_config;
use crate::{chain_id::ChainId, network_id::NetworkId};
use crate::network_id::NetworkId;
use libra_secure_storage::{KVStorage, Storage};
use libra_types::waypoint::Waypoint;
use libra_types::{chain_id::ChainId, waypoint::Waypoint};
pub use test_config::*;

/// Config pulls in configuration information from the config file.
Expand Down
1 change: 0 additions & 1 deletion config/src/lib.rs
Expand Up @@ -3,7 +3,6 @@

#![forbid(unsafe_code)]

pub mod chain_id;
pub mod config;
pub mod generator;
pub mod keys;
Expand Down
3 changes: 1 addition & 2 deletions network/builder/src/builder.rs
Expand Up @@ -11,7 +11,6 @@
//! long as the latter is in its trusted peers set.
use channel::{self, message_queues::QueueStyle};
use libra_config::{
chain_id::ChainId,
config::{DiscoveryMethod, NetworkConfig, RoleType, HANDSHAKE_VERSION},
network_id::{NetworkContext, NetworkId},
};
Expand All @@ -22,7 +21,7 @@ use libra_network_address::{
encrypted::{TEST_SHARED_VAL_NETADDR_KEY, TEST_SHARED_VAL_NETADDR_KEY_VERSION},
NetworkAddress,
};
use libra_types::PeerId;
use libra_types::{chain_id::ChainId, PeerId};
use network::{
connectivity_manager::{builder::ConnectivityManagerBuilder, ConnectivityRequest},
constants,
Expand Down
4 changes: 2 additions & 2 deletions network/builder/src/dummy.rs
Expand Up @@ -6,11 +6,11 @@
use crate::builder::NetworkBuilder;
use channel::message_queues::QueueStyle;
use futures::{executor::block_on, StreamExt};
use libra_config::{chain_id::ChainId, config::RoleType, network_id::NetworkId};
use libra_config::{config::RoleType, network_id::NetworkId};
use libra_crypto::{test_utils::TEST_SEED, x25519, Uniform};
use libra_metrics::IntCounterVec;
use libra_network_address::NetworkAddress;
use libra_types::PeerId;
use libra_types::{chain_id::ChainId, PeerId};
use netcore::transport::ConnectionOrigin;
use network::{
constants::{MAX_FRAME_SIZE, NETWORK_CHANNEL_SIZE},
Expand Down
4 changes: 2 additions & 2 deletions network/src/peer_manager/builder.rs
Expand Up @@ -13,12 +13,12 @@ use crate::{
ProtocolId,
};
use channel::{self, libra_channel, message_queues::QueueStyle};
use libra_config::{chain_id::ChainId, config::HANDSHAKE_VERSION, network_id::NetworkContext};
use libra_config::{config::HANDSHAKE_VERSION, network_id::NetworkContext};
use libra_crypto::x25519;
use libra_logger::prelude::*;
use libra_metrics::IntCounterVec;
use libra_network_address::NetworkAddress;
use libra_types::PeerId;
use libra_types::{chain_id::ChainId, PeerId};
use netcore::transport::{
memory::MemoryTransport,
tcp::{TcpSocket, TcpTransport},
Expand Down
3 changes: 2 additions & 1 deletion network/src/protocols/wire/handshake/v1/mod.rs
Expand Up @@ -10,7 +10,8 @@
//! supported over that messaging protocol. On receipt, both ends will determine the highest
//! intersecting messaging protocol version and use that for the remainder of the session.

use libra_config::{chain_id::ChainId, network_id::NetworkId};
use libra_config::network_id::NetworkId;
use libra_types::chain_id::ChainId;
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, convert::TryInto, fmt, iter::Iterator};

Expand Down
4 changes: 2 additions & 2 deletions network/src/transport.rs
Expand Up @@ -14,11 +14,11 @@ use futures::{
io::{AsyncRead, AsyncWrite},
stream::{Stream, StreamExt, TryStreamExt},
};
use libra_config::{chain_id::ChainId, config::HANDSHAKE_VERSION, network_id::NetworkId};
use libra_config::{config::HANDSHAKE_VERSION, network_id::NetworkId};
use libra_crypto::x25519;
use libra_logger::prelude::*;
use libra_network_address::{parse_dns_tcp, parse_ip_tcp, parse_memory, NetworkAddress};
use libra_types::PeerId;
use libra_types::{chain_id::ChainId, PeerId};
use netcore::transport::{tcp, ConnectionOrigin, Transport};
use serde::Serialize;
use std::{
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions types/src/lib.rs
Expand Up @@ -10,6 +10,7 @@ pub mod account_state;
pub mod account_state_blob;
pub mod block_info;
pub mod block_metadata;
pub mod chain_id;
pub mod contract_event;
pub mod epoch_change;
pub mod epoch_state;
Expand Down

0 comments on commit b0615b8

Please sign in to comment.