Skip to content

Commit

Permalink
p2p: break out tests into separate crate
Browse files Browse the repository at this point in the history
In order to explore a path forward where testing utilities as well as
the assertions for a single and across crates, this change moves the
secret connection tests into the newly introduced test crate.

Signed-off-by: Alexander Simmerl <a.simmerl@gmail.com>
  • Loading branch information
xla committed Jun 11, 2021
1 parent 4e0e61c commit aa3f2db
Show file tree
Hide file tree
Showing 21 changed files with 428 additions and 314 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `[p2p]` Remove superfluous module name suffixes in `p2p::error`
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ jobs:
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: wasm-pack test --headless --chrome ./light-client-js/
- run: wasm-pack test --headless --firefox ./light-client-js/

tendermint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test-all-features
args: -p tendermint-test

tendermint-testgen:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Cargo
# will have compiled files and executables
/target/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ members = [
"light-client",
"light-client-js",
"p2p",
"pbt-gen",
"proto",
"rpc",
"tendermint",
"testgen",
"pbt-gen"
"test",
"testgen"
]

exclude = [
Expand Down
33 changes: 17 additions & 16 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
[package]
name = "tendermint-p2p"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
readme = "README.md"
keywords = ["p2p", "tendermint", "cosmos"]
authors = [
name = "tendermint-p2p"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
homepage = "https://tendermint.com"
readme = "README.md"
keywords = ["p2p", "tendermint", "cosmos"]
categories = ["cryptography::cryptocurrencies", "network-programming"]
authors = [
"Tony Arcieri <tony@iqlusion.io>",
"Ismail Khoffi <Ismail.Khoffi@gmail.com>"
]

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

[lib]
test = false

[features]
amino = ["prost-amino", "prost-amino-derive"]

[dependencies]
chacha20poly1305 = "0.7"
ed25519-dalek = "1"
Expand All @@ -26,7 +34,6 @@ prost = "0.7"
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"
Expand All @@ -38,9 +45,3 @@ tendermint-proto = { path = "../proto", version = "0.19.0" }
# optional dependencies
prost-amino = { version = "0.6", optional = true }
prost-amino-derive = { version = "0.6", optional = true }

[dev-dependencies]
readwrite = "^0.1.1"

[features]
amino = ["prost-amino", "prost-amino-derive"]
4 changes: 2 additions & 2 deletions p2p/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use thiserror::Error;
pub enum Error {
/// Cryptographic operation failed
#[error("cryptographic error")]
CryptoError,
Crypto,

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

/// Network protocol-related errors
#[error("protocol error")]
ProtocolError,
Protocol,
}
17 changes: 14 additions & 3 deletions p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

#![forbid(unsafe_code)]
#![deny(
nonstandard_style,
private_in_public,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_import_braces,
unused_qualifications,
rust_2018_idioms,
nonstandard_style
unused_qualifications
)]
#![warn(
clippy::all,
clippy::cargo,
clippy::nursery,
clippy::pedantic,
clippy::unwrap_used,
missing_docs,
unused_import_braces,
unused_qualifications
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-p2p/0.19.0",
Expand Down
Loading

0 comments on commit aa3f2db

Please sign in to comment.