Skip to content

Commit

Permalink
use secret_connection from tendermint_p2p crate (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
melekes committed Dec 1, 2020
1 parent 75d1bff commit de115cd
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 925 deletions.
29 changes: 26 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ edition = "2018"
abscissa_core = "0.5"
abscissa_tokio = { version = "0.5", optional = true }
bytes = "0.5"
chacha20poly1305 = "0.7"
chrono = "0.4"
ed25519-dalek = "1"
getrandom = "0.1"
Expand All @@ -25,7 +24,6 @@ hyper = { version = "0.13", optional = true }
hyper-rustls = { version = "0.21", optional = true }
k256 = { version = "0.5", features = ["ecdsa", "sha256"] }
ledger = { version = "0.2", optional = true }
merlin = "2"
once_cell = "1.5"
prost = "0.6"
prost-amino = "0.6"
Expand All @@ -44,9 +42,9 @@ tempfile = "3"
tendermint = { version = "=0.17.0-rc3", features = ["secp256k1"] }
tendermint-rpc = { version = "=0.17.0-rc3", optional = true, features = ["http-client"] }
tendermint-proto = "=0.17.0-rc3"
tendermint-p2p = { version = "=0.17.0-rc3", features = ["amino"] }
thiserror = "1"
wait-timeout = "0.2"
x25519-dalek = "1.1"
yubihsm = { version = "0.35", features = ["secp256k1", "setup", "usb"], optional = true }
zeroize = "1"

Expand Down
4 changes: 2 additions & 2 deletions src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod config_builder;
pub mod networks;

use self::{config_builder::ConfigBuilder, networks::Network};
use crate::{config::CONFIG_FILE_NAME, connection::secret_connection, prelude::*};
use crate::{config::CONFIG_FILE_NAME, key_utils, prelude::*};
use abscissa_core::{Command, Options, Runnable};
use std::{
fs,
Expand Down Expand Up @@ -106,7 +106,7 @@ impl Runnable for InitCommand {
status_ok!("Generated", "KMS configuration: {}", config_path.display());

let secret_connection_key = secrets_dir.join(SECRET_CONNECTION_KEY);
secret_connection::generate_key(&secret_connection_key).unwrap_or_else(|e| {
key_utils::generate_key(&secret_connection_key).unwrap_or_else(|e| {
abort!(
"couldn't generate `{}`: {}",
secret_connection_key.display(),
Expand Down
2 changes: 1 addition & 1 deletion src/config/validator.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Validator configuration

use crate::connection::secret_connection;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use tendermint::{chain, net};
use tendermint_p2p::secret_connection;

/// Validator configuration
#[derive(Clone, Debug, Deserialize, Serialize)]
Expand Down
10 changes: 6 additions & 4 deletions src/connection.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//! Connections to a validator (TCP or Unix socket)

pub mod secret_connection;
use std::io;

use tendermint_p2p::secret_connection::SecretConnection;

use self::unix::UnixConnection;

pub mod tcp;
pub mod unix;

use self::{secret_connection::SecretConnection, unix::UnixConnection};
use std::io;

/// Connections to a validator
pub trait Connection: io::Read + io::Write + Sync + Send {}

Expand Down
Loading

0 comments on commit de115cd

Please sign in to comment.