Skip to content

Commit

Permalink
p2p: migrate secret_connection from tmkms (#696)
Browse files Browse the repository at this point in the history
* p2p: migrate secret_connection from tmkms

Closes #691

* bring back versions, remove generate_key

* return proper error

* format code

* fixes after xla review

* fixes after @tony-iqlusion review

* specify tendermint and tendermint-proto as path dependencies

* more fixes after @xla review

* remove warnings from lib.rs

melekes@9e253df#r44484475

* make amino dependencies optional
  • Loading branch information
melekes committed Nov 27, 2020
1 parent 5105efe commit ab81ed2
Show file tree
Hide file tree
Showing 10 changed files with 988 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
members = [
"light-client",
"light-node",
"p2p",
"proto",
"rpc",
"rpc-probe",
Expand Down
42 changes: 42 additions & 0 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "tendermint-p2p"
version = "0.1.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
readme = "README.md"
keywords = ["p2p", "tendermint", "cosmos"]
authors = [
"Tony Arcieri <tony@iqlusion.io>",
"Ismail Khoffi <Ismail.Khoffi@gmail.com>"
]

description = """
The Tendermint P2P stack.
"""

[dependencies]
chacha20poly1305 = "0.7"
ed25519-dalek = "1"
eyre = "0.6"
hkdf = "0.10.0"
merlin = "2"
prost = "0.6"
rand_core = { version = "0.5", features = ["std"] }
sha2 = "0.9"
subtle = "2"
subtle-encoding = { version = "0.5" }
thiserror = "1"
x25519-dalek = "1.1"
zeroize = "1"

# path dependencies
tendermint = { path = "../tendermint", version = "=0.17.0-rc3" }
tendermint-proto = { path = "../proto", version = "=0.17.0-rc3" }

# optional dependencies
prost-amino = { version = "0.6", optional = true }
prost-amino-derive = { version = "0.6", optional = true }

[features]
amino = ["prost-amino", "prost-amino-derive"]
19 changes: 19 additions & 0 deletions p2p/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Error types

use thiserror::Error;

/// Kinds of errors
#[derive(Copy, Clone, Debug, Error, Eq, PartialEq)]
pub enum Error {
/// Cryptographic operation failed
#[error("cryptographic error")]
CryptoError,

/// Malformatted or otherwise invalid cryptographic key
#[error("invalid key")]
InvalidKey,

/// Network protocol-related errors
#[error("protocol error")]
ProtocolError,
}
18 changes: 18 additions & 0 deletions p2p/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! The Tendermint P2P stack.

#![forbid(unsafe_code)]
#![deny(
trivial_casts,
trivial_numeric_casts,
unused_import_braces,
unused_qualifications,
rust_2018_idioms,
nonstandard_style
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-p2p/0.1.0",
html_logo_url = "https://raw.githubusercontent.com/informalsystems/tendermint-rs/master/img/logo-tendermint-rs_3961x4001.png"
)]

pub mod error;
pub mod secret_connection;
Loading

0 comments on commit ab81ed2

Please sign in to comment.