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

p2p: break out tests into separate crate #898

Merged
merged 1 commit into from
Jun 11, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These would be considered API-breaking changes, right? If so, please add an entry to .changelog/unreleased/breaking-changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an entry, could you double check that this correctly formatted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good - we can always tweak formatting during the next release.


/// 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