Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize crate name with massa_ prefix #1920

Merged
merged 1 commit into from Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
660 changes: 312 additions & 348 deletions Cargo.lock

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions Cargo.toml
@@ -1,19 +1,18 @@
[workspace]

members = [
"api",
"bootstrap",
"network",
"consensus",
"massa_hash",
"logging",
"massa-node",
"models",
"pool",
"massa-client",
"protocol-worker",
"protocol-exports",
"signature",
"time",
"wallet",
"massa-api",
"massa-bootstrap",
"massa-client",
"massa-consensus",
"massa-hash",
"massa-logging",
"massa-models",
"massa-network",
"massa-node",
"massa-pool",
"massa-protocol-exports",
"massa-protocol-worker",
"massa-signature",
"massa-time",
"massa-wallet",
]
25 changes: 0 additions & 25 deletions api/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion bors.toml
@@ -1,2 +1,2 @@
status = [ "build" ]
status = ["build"]
delete_merged_branches = true
25 changes: 25 additions & 0 deletions massa-api/Cargo.toml
@@ -0,0 +1,25 @@
[package]
name = "massa_api"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
displaydoc = "0.2"
futures = "0.3"
jsonrpc-core = "18.0.0"
jsonrpc-derive = "18.0.0"
jsonrpc-http-server = "18.0.0"
thiserror = "1.0"
tokio = { version = "1.11", features = ["full"] }
tracing = "0.1"
# custom modules
massa_consensus = { path = "../massa-consensus" }
massa_hash = { path = "../massa-hash" }
massa_models = { path = "../massa-models" }
massa_network = { path = "../massa-network" }
massa_pool = { path = "../massa-pool" }
massa_protocol_exports = { path = "../massa-protocol-exports" }
massa_signature = { path = "../massa-signature" }
massa_time = { path = "../massa-time" }
10 changes: 5 additions & 5 deletions api/src/error.rs → massa-api/src/error.rs
@@ -1,13 +1,13 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

use consensus::ConsensusError;
use displaydoc::Display;
use massa_consensus::ConsensusError;
use massa_hash::MassaHashError;
use models::ModelsError;
use network::NetworkError;
use pool::PoolError;
use massa_models::ModelsError;
use massa_network::NetworkError;
use massa_pool::PoolError;
use massa_time::TimeError;
use thiserror::Error;
use time::TimeError;

#[non_exhaustive]
#[derive(Display, Error, Debug)]
Expand Down
22 changes: 11 additions & 11 deletions api/src/lib.rs → massa-api/src/lib.rs
Expand Up @@ -4,24 +4,24 @@
#![doc = include_str!("../../docs/api.md")]

use crate::error::ApiError::WrongAPI;
use consensus::{ConsensusCommandSender, ConsensusConfig};
use error::ApiError;
use jsonrpc_core::{BoxFuture, IoHandler, Value};
use jsonrpc_derive::rpc;
use jsonrpc_http_server::{CloseHandle, ServerBuilder};
use models::address::{AddressHashMap, AddressHashSet};
use models::api::{
use massa_consensus::{ConsensusCommandSender, ConsensusConfig};
use massa_models::address::{AddressHashMap, AddressHashSet};
use massa_models::api::{
APISettings, AddressInfo, BlockInfo, BlockSummary, EndorsementInfo, NodeStatus, OperationInfo,
TimeInterval,
};
use models::clique::Clique;
use models::massa_hash::PubkeySig;
use models::node::NodeId;
use models::operation::{Operation, OperationId};
use models::{Address, BlockId, EndorsementId, Version};
use network::{NetworkCommandSender, NetworkSettings};
use pool::PoolCommandSender;
use signature::PrivateKey;
use massa_models::clique::Clique;
use massa_models::massa_hash::PubkeySig;
use massa_models::node::NodeId;
use massa_models::operation::{Operation, OperationId};
use massa_models::{Address, BlockId, EndorsementId, Version};
use massa_network::{NetworkCommandSender, NetworkSettings};
use massa_pool::PoolCommandSender;
use massa_signature::PrivateKey;
use std::net::{IpAddr, SocketAddr};
use std::thread;
use std::thread::JoinHandle;
Expand Down
16 changes: 8 additions & 8 deletions api/src/private.rs → massa-api/src/private.rs
Expand Up @@ -2,19 +2,19 @@

use crate::error::ApiError;
use crate::{Endpoints, Private, RpcServer, StopHandle, API};
use consensus::{ConsensusCommandSender, ConsensusConfig};
use jsonrpc_core::BoxFuture;
use jsonrpc_http_server::tokio::sync::mpsc;
use models::address::{AddressHashMap, AddressHashSet};
use models::api::{
use massa_consensus::{ConsensusCommandSender, ConsensusConfig};
use massa_models::address::{AddressHashMap, AddressHashSet};
use massa_models::api::{
APISettings, AddressInfo, BlockInfo, BlockSummary, EndorsementInfo, NodeStatus, OperationInfo,
TimeInterval,
};
use models::clique::Clique;
use models::massa_hash::PubkeySig;
use models::{Address, BlockId, EndorsementId, Operation, OperationId};
use network::NetworkCommandSender;
use signature::PrivateKey;
use massa_models::clique::Clique;
use massa_models::massa_hash::PubkeySig;
use massa_models::{Address, BlockId, EndorsementId, Operation, OperationId};
use massa_network::NetworkCommandSender;
use massa_signature::PrivateKey;
use std::net::{IpAddr, SocketAddr};

impl API<Private> {
Expand Down
30 changes: 15 additions & 15 deletions api/src/public.rs → massa-api/src/public.rs
Expand Up @@ -2,30 +2,30 @@
#![allow(clippy::too_many_arguments)]
use crate::error::ApiError;
use crate::{Endpoints, Public, RpcServer, StopHandle, API};
use consensus::{
ConsensusCommandSender, ConsensusConfig, DiscardReason, ExportBlockStatus, Status,
};
use futures::{stream::FuturesUnordered, StreamExt};
use jsonrpc_core::BoxFuture;
use models::address::{AddressHashMap, AddressHashSet};
use models::api::{
use massa_consensus::{
ConsensusCommandSender, ConsensusConfig, DiscardReason, ExportBlockStatus, Status,
};
use massa_models::address::{AddressHashMap, AddressHashSet};
use massa_models::api::{
APISettings, AddressInfo, BlockInfo, BlockInfoContent, BlockSummary, EndorsementInfo,
IndexedSlot, NodeStatus, OperationInfo, TimeInterval,
};
use models::clique::Clique;
use models::hhasher::BuildHHasher;
use models::massa_hash::PubkeySig;
use models::node::NodeId;
use models::timeslots::{get_latest_block_slot_at_timestamp, time_range_to_slot_range};
use models::{
use massa_models::clique::Clique;
use massa_models::hhasher::BuildHHasher;
use massa_models::massa_hash::PubkeySig;
use massa_models::node::NodeId;
use massa_models::timeslots::{get_latest_block_slot_at_timestamp, time_range_to_slot_range};
use massa_models::{
Address, BlockHashSet, BlockId, EndorsementHashSet, EndorsementId, Operation, OperationHashMap,
OperationHashSet, OperationId, Slot, Version,
};
use network::{NetworkCommandSender, NetworkSettings};
use pool::PoolCommandSender;
use signature::PrivateKey;
use massa_network::{NetworkCommandSender, NetworkSettings};
use massa_pool::PoolCommandSender;
use massa_signature::PrivateKey;
use massa_time::UTime;
use std::net::{IpAddr, SocketAddr};
use time::UTime;

impl API<Public> {
pub fn new(
Expand Down
18 changes: 9 additions & 9 deletions bootstrap/Cargo.toml → massa-bootstrap/Cargo.toml
@@ -1,5 +1,5 @@
[package]
name = "bootstrap"
name = "massa_bootstrap"
version = "0.1.0"
authors = ["Massa Labs <info@massa.net>"]
edition = "2021"
Expand All @@ -11,20 +11,20 @@ displaydoc = "0.2"
futures = "0.3"
lazy_static = "1.4.0"
num_enum = "0.5"
rand = { version = "0.8"}
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1.11", features = ["full"] }
tracing = "0.1"
# custom modules
consensus = { path = "../consensus" }
massa_hash = { path = "../massa_hash" }
logging = {path = "../logging"}
models = { path = "../models" }
network = {path = "../network"}
signature = { path = "../signature" }
time = {path = "../time"}
massa_consensus = { path = "../massa-consensus" }
massa_hash = { path = "../massa-hash" }
massa_logging = { path = "../massa-logging" }
massa_models = { path = "../massa-models" }
massa_network = { path = "../massa-network" }
massa_signature = { path = "../massa-signature" }
massa_time = { path = "../massa-time" }

[dev-dependencies]
bitvec = { version = "0.22", features = ["serde"] }
Expand Down
Expand Up @@ -5,9 +5,9 @@ use crate::error::BootstrapError;
use crate::establisher::Duplex;
use crate::settings::BOOTSTRAP_RANDOMNESS_SIZE_BYTES;
use massa_hash::hash::Hash;
use models::{with_serialization_context, DeserializeCompact, DeserializeMinBEInt};
use massa_models::{with_serialization_context, DeserializeCompact, DeserializeMinBEInt};
use massa_signature::{verify_signature, PublicKey, Signature, SIGNATURE_SIZE_BYTES};
use rand::{rngs::StdRng, RngCore, SeedableRng};
use signature::{verify_signature, PublicKey, Signature, SIGNATURE_SIZE_BYTES};
use tokio::io::AsyncReadExt;
use tokio::io::AsyncWriteExt;

Expand Down
8 changes: 4 additions & 4 deletions bootstrap/src/error.rs → massa-bootstrap/src/error.rs
@@ -1,12 +1,12 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

use crate::messages::BootstrapMessage;
use consensus::error::ConsensusError;
use displaydoc::Display;
use massa_consensus::error::ConsensusError;
use massa_hash::MassaHashError;
use network::NetworkError;
use massa_network::NetworkError;
use massa_time::TimeError;
use thiserror::Error;
use time::TimeError;

#[non_exhaustive]
#[derive(Display, Error, Debug)]
Expand All @@ -16,7 +16,7 @@ pub enum BootstrapError {
/// general bootstrap error: {0}
GeneralError(String),
/// models error: {0}
ModelsError(#[from] models::ModelsError),
ModelsError(#[from] massa_models::ModelsError),
/// unexpected message from bootstrap node: {0:?}
UnexpectedMessage(BootstrapMessage),
/// connection with bootstrap node dropped
Expand Down
@@ -1,9 +1,9 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

#[cfg(not(test))]
use std::{io, net::SocketAddr};
use massa_time::UTime;
#[cfg(not(test))]
use time::UTime;
use std::{io, net::SocketAddr};
#[cfg(not(test))]
use tokio::{
net::{TcpListener, TcpStream},
Expand Down
14 changes: 7 additions & 7 deletions bootstrap/src/lib.rs → massa-bootstrap/src/lib.rs
Expand Up @@ -3,21 +3,21 @@
use crate::client_binder::BootstrapClientBinder;
use crate::establisher::Duplex;
use crate::server_binder::BootstrapServerBinder;
use consensus::{BootstrapableGraph, ConsensusCommandSender, ExportProofOfStake};
use error::BootstrapError;
pub use establisher::Establisher;
use futures::{stream::FuturesUnordered, StreamExt};
use logging::massa_trace;
use massa_consensus::{BootstrapableGraph, ConsensusCommandSender, ExportProofOfStake};
use massa_logging::massa_trace;
use massa_models::Version;
use massa_network::{BootstrapPeers, NetworkCommandSender};
use massa_signature::{PrivateKey, PublicKey};
use massa_time::UTime;
use messages::BootstrapMessage;
use models::Version;
use network::{BootstrapPeers, NetworkCommandSender};
use rand::{prelude::SliceRandom, rngs::StdRng, SeedableRng};
pub use settings::BootstrapSettings;
use signature::{PrivateKey, PublicKey};
use settings::BootstrapSettings;
use std::collections::{hash_map, HashMap};
use std::net::SocketAddr;
use std::{convert::TryInto, net::IpAddr};
use time::UTime;
use tokio::time::Instant;
use tokio::{sync::mpsc, task::JoinHandle, time::sleep};
use tracing::{debug, info, warn};
Expand Down
8 changes: 4 additions & 4 deletions bootstrap/src/messages.rs → massa-bootstrap/src/messages.rs
@@ -1,14 +1,14 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

use consensus::{BootstrapableGraph, ExportProofOfStake};
use models::{
use massa_consensus::{BootstrapableGraph, ExportProofOfStake};
use massa_models::{
DeserializeCompact, DeserializeVarInt, ModelsError, SerializeCompact, SerializeVarInt, Version,
};
use network::BootstrapPeers;
use massa_network::BootstrapPeers;
use massa_time::UTime;
use num_enum::{IntoPrimitive, TryFromPrimitive};
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use time::UTime;

/// Messages used during bootstrap
#[derive(Debug, Serialize, Deserialize)]
Expand Down
Expand Up @@ -6,9 +6,9 @@ use crate::establisher::Duplex;
use crate::settings::BOOTSTRAP_RANDOMNESS_SIZE_BYTES;
use massa_hash::hash::Hash;
use massa_hash::HASH_SIZE_BYTES;
use models::SerializeMinBEInt;
use models::{with_serialization_context, SerializeCompact};
use signature::{sign, PrivateKey, Signature, SIGNATURE_SIZE_BYTES};
use massa_models::SerializeMinBEInt;
use massa_models::{with_serialization_context, SerializeCompact};
use massa_signature::{sign, PrivateKey, Signature, SIGNATURE_SIZE_BYTES};
use std::convert::TryInto;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

Expand Down
4 changes: 2 additions & 2 deletions bootstrap/src/settings.rs → massa-bootstrap/src/settings.rs
@@ -1,9 +1,9 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

use massa_signature::PublicKey;
use massa_time::UTime;
use serde::Deserialize;
use signature::PublicKey;
use std::net::SocketAddr;
use time::UTime;

/// Max message size for bootstrap
pub const MAX_BOOTSTRAP_MESSAGE_SIZE: u32 = 1048576000;
Expand Down
@@ -1,8 +1,8 @@
// Copyright (c) 2021 MASSA LABS <info@massa.net>

use massa_time::UTime;
use std::io;
use std::net::SocketAddr;
use time::UTime;
use tokio::io::DuplexStream;
use tokio::sync::{mpsc, oneshot};
use tokio::time::timeout;
Expand Down
File renamed without changes.