Skip to content

Commit 3e65a3a

Browse files
authored
Merge branch 'master' into master
2 parents f845c18 + b20fe13 commit 3e65a3a

File tree

16 files changed

+256
-87
lines changed

16 files changed

+256
-87
lines changed

Cargo.lock

Lines changed: 206 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ edition = "2018"
1818
app_dirs = "^1.2.1"
1919
clap = { version = "2", features = ["yaml"] }
2020
codechain-core = { path = "core" }
21-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
21+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
2222
codechain-discovery = { path = "discovery" }
2323
codechain-logger = { path = "util/logger" }
2424
codechain-key = { path = "key" }

core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ authors = ["CodeChain Team <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
9-
codechain-db = { git = "https://github.com/CodeChain-io/rust-codechain-db.git", version = "0.1" }
8+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
9+
codechain-db = { git = "https://github.com/CodeChain-io/rust-codechain-db.git", version = "0.2" }
1010
codechain-io = { path = "../util/io" }
1111
codechain-json = { path = "../json" }
1212
codechain-key = { path = "../key" }
@@ -25,7 +25,7 @@ kvdb-memorydb = "0.1"
2525
linked-hash-map = "0.5"
2626
log = "0.4.6"
2727
lru-cache = "0.1.2"
28-
merkle-trie = { git = "https://github.com/CodeChain-io/rust-merkle-trie.git", version = "0.2" }
28+
merkle-trie = { git = "https://github.com/CodeChain-io/rust-merkle-trie.git", version = "0.4" }
2929
num-rational = "0.2.1"
3030
parking_lot = "0.6.0"
3131
primitives = { git = "https://github.com/CodeChain-io/rust-codechain-primitives.git", version = "0.4" }

discovery/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["CodeChain Team <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
8+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
99
codechain-key = { path = "../key" }
1010
codechain-logger = { path = "../util/logger" }
1111
codechain-network = { path = "../network" }

key/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rustc-hex = "1.0"
1010
rustc-serialize = "0.3"
1111
lazy_static = "1.2"
1212
bech32 = "0.2.2"
13-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
13+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
1414
never-type = "0.1.0"
1515
parking_lot = "0.6.0"
1616
primitives = { git = "https://github.com/CodeChain-io/rust-codechain-primitives.git", version = "0.4" }

keystore/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ serde_derive = "1.0"
1717
rustc-hex = "1.0"
1818
time = "0.1.34"
1919
parking_lot = "0.6.0"
20-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
20+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
2121
smallvec = "0.4"
2222
tempdir = "0.3"
2323

network/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["CodeChain Team <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }
8+
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.2" }
99
codechain-io = { path = "../util/io" }
1010
codechain-key = { path = "../key" }
1111
codechain-logger = { path = "../util/logger" }

network/src/p2p/connection/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -19,7 +19,7 @@ mod incoming;
1919
mod message;
2020
mod outgoing;
2121

22-
use ccrypto::aes::SymmetricCipherError;
22+
use ccrypto::error::SymmError;
2323
use rlp::DecoderError;
2424
use std::fmt;
2525
use std::io;
@@ -35,7 +35,7 @@ use super::stream::Error as P2pStreamError;
3535

3636
#[derive(Debug)]
3737
pub enum Error {
38-
SymmetricCipher(SymmetricCipherError),
38+
SymmetricCipher(SymmError),
3939
IoError(io::Error),
4040
Decoder(DecoderError),
4141
InvalidSign,
@@ -77,8 +77,8 @@ impl From<P2pStreamError> for Error {
7777
}
7878
}
7979

80-
impl From<SymmetricCipherError> for Error {
81-
fn from(err: SymmetricCipherError) -> Self {
80+
impl From<SymmError> for Error {
81+
fn from(err: SymmError) -> Self {
8282
Error::SymmetricCipher(err)
8383
}
8484
}

network/src/p2p/handler.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2019 Kodebox, Inc.
1+
// Copyright 2018-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -23,7 +23,7 @@ use crate::client::Client;
2323
use crate::session::Session;
2424
use crate::stream::Stream;
2525
use crate::{FiltersControl, NodeId, RoutingTable, SocketAddr};
26-
use ccrypto::aes::SymmetricCipherError;
26+
use ccrypto::error::SymmError;
2727
use cio::{IoChannel, IoContext, IoHandler, IoHandlerResult, IoManager, StreamToken, TimerToken};
2828
use ckey::NetworkId;
2929
use finally_block::finally;
@@ -1155,8 +1155,8 @@ impl IoHandler<Message> for Handler {
11551155
}
11561156
}
11571157

1158-
impl From<SymmetricCipherError> for Error {
1159-
fn from(err: SymmetricCipherError) -> Self {
1158+
impl From<SymmError> for Error {
1159+
fn from(err: SymmError) -> Self {
11601160
Error::SymmetricCipher(err)
11611161
}
11621162
}
@@ -1186,7 +1186,7 @@ pub enum Message {
11861186
#[derive(Debug)]
11871187
enum Error {
11881188
InvalidNode(NodeId),
1189-
SymmetricCipher(SymmetricCipherError),
1189+
SymmetricCipher(SymmError),
11901190
}
11911191

11921192
impl ::std::fmt::Display for Error {

network/src/p2p/message/extension.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2019 Kodebox, Inc.
1+
// Copyright 2018-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,8 @@
1717
use super::ENCRYPTED_ID;
1818
use super::UNENCRYPTED_ID;
1919
use crate::session::Session;
20-
use ccrypto::aes::{self, SymmetricCipherError};
20+
use ccrypto::aes;
21+
use ccrypto::error::SymmError;
2122
use primitives::Bytes;
2223
use rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream};
2324
use std::sync::Arc;
@@ -46,7 +47,7 @@ impl Message {
4647
extension_name: String,
4748
unencrypted_data: &[u8],
4849
session: &Session,
49-
) -> Result<Self, SymmetricCipherError> {
50+
) -> Result<Self, SymmError> {
5051
let encrypted = aes::encrypt(unencrypted_data, session.secret(), &session.nonce())?;
5152
Ok(Self::encrypted(extension_name, encrypted))
5253
}
@@ -72,7 +73,7 @@ impl Message {
7273
}
7374
}
7475

75-
pub fn unencrypted_data(&self, session: &Session) -> Result<Arc<Bytes>, SymmetricCipherError> {
76+
pub fn unencrypted_data(&self, session: &Session) -> Result<Arc<Bytes>, SymmError> {
7677
match self {
7778
Message::Encrypted {
7879
encrypted,

0 commit comments

Comments
 (0)