Skip to content

Commit a91edf7

Browse files
Seulgi Kimsgkim126
Seulgi Kim
authored andcommitted
Use 2018 edition
1 parent a0cd93a commit a91edf7

File tree

53 files changed

+70
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+70
-39
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ exclude = [
1212
"spec/*",
1313
"test/*",
1414
]
15+
edition = "2018"
1516

1617
[dependencies]
1718
app_dirs = "^1.2.1"

core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-core"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

core/src/client/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl Client {
9292
message_channel: IoChannel<ClientIoMessage>,
9393
reseal_timer: TimerApi,
9494
) -> Result<Arc<Client>, Error> {
95-
let journal_db = journaldb::new(Arc::clone(&db), journaldb::Algorithm::Archive, ::db::COL_STATE);
95+
let journal_db = journaldb::new(Arc::clone(&db), journaldb::Algorithm::Archive, crate::db::COL_STATE);
9696
let mut state_db = StateDB::new(journal_db);
9797
if !scheme.check_genesis_root(state_db.as_hashdb()) {
9898
return Err(SchemeError::InvalidState.into())
@@ -607,7 +607,7 @@ impl BlockChainTrait for Client {
607607
self.genesis_accounts.iter().map(|addr| PlatformAddress::new_v1(network_id, *addr)).collect()
608608
}
609609

610-
fn block_header(&self, id: &BlockId) -> Option<::encoded::Header> {
610+
fn block_header(&self, id: &BlockId) -> Option<encoded::Header> {
611611
let chain = self.block_chain();
612612

613613
Self::block_hash(&chain, id).and_then(|hash| chain.block_header_data(&hash))
@@ -635,7 +635,7 @@ impl BlockChainTrait for Client {
635635
self.transaction_address(id).map(|addr| addr.block_hash)
636636
}
637637

638-
fn transaction_header(&self, tracker: &Tracker) -> Option<::encoded::Header> {
638+
fn transaction_header(&self, tracker: &Tracker) -> Option<encoded::Header> {
639639
self.transaction_addresses(tracker).map(|addr| addr.block_hash).and_then(|hash| self.block_header(&hash.into()))
640640
}
641641
}
@@ -655,7 +655,7 @@ impl ImportBlock for Client {
655655
}
656656

657657
fn import_header(&self, bytes: Bytes) -> Result<BlockHash, BlockImportError> {
658-
let unverified = ::encoded::Header::new(bytes).decode();
658+
let unverified = encoded::Header::new(bytes).decode();
659659
{
660660
if self.block_chain().is_known_header(&unverified.hash()) {
661661
return Err(BlockImportError::Import(ImportError::AlreadyInChain))

core/src/client/importer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use rlp::Encodable;
2929
use super::{BlockChainTrait, Client, ClientConfig};
3030
use crate::block::{enact, IsBlock, LockedBlock};
3131
use crate::blockchain::{BodyProvider, HeaderProvider, ImportRoute};
32+
use crate::client::EngineInfo;
3233
use crate::consensus::CodeChainEngine;
3334
use crate::error::Error;
3435
use crate::miner::{Miner, MinerService};
@@ -37,7 +38,6 @@ use crate::types::BlockId;
3738
use crate::verification::queue::{BlockQueue, HeaderQueue};
3839
use crate::verification::{self, PreverifiedBlock, Verifier};
3940
use crate::views::{BlockView, HeaderView};
40-
use client::EngineInfo;
4141

4242
pub struct Importer {
4343
/// Lock used during block import

core/src/client/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub trait BlockChainTrait {
7575
/// Get the hash of block that contains the transaction, if any.
7676
fn transaction_block(&self, id: &TransactionId) -> Option<BlockHash>;
7777

78-
fn transaction_header(&self, tracker: &Tracker) -> Option<::encoded::Header>;
78+
fn transaction_header(&self, tracker: &Tracker) -> Option<encoded::Header>;
7979

8080
fn transaction_block_number(&self, tracker: &Tracker) -> Option<BlockNumber> {
8181
self.transaction_header(tracker).map(|header| header.number())

core/src/client/test_client.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ use rlp::*;
5454

5555
use crate::block::{ClosedBlock, OpenBlock, SealedBlock};
5656
use crate::blockchain_info::BlockChainInfo;
57-
use crate::client::ImportResult;
5857
use crate::client::{
59-
AccountData, BlockChainClient, BlockChainTrait, BlockProducer, BlockStatus, EngineInfo, ImportBlock,
60-
MiningBlockChainClient, StateInfo, StateOrBlock, TermInfo,
58+
AccountData, BlockChainClient, BlockChainTrait, BlockProducer, BlockStatus, ConsensusClient, EngineInfo,
59+
ImportBlock, ImportResult, MiningBlockChainClient, StateInfo, StateOrBlock, TermInfo,
6160
};
6261
use crate::consensus::stake::{Validator, Validators};
6362
use crate::consensus::EngineError;
@@ -68,7 +67,6 @@ use crate::miner::{Miner, MinerService, TransactionImportResult};
6867
use crate::scheme::Scheme;
6968
use crate::transaction::{LocalizedTransaction, PendingSignedTransactions, SignedTransaction};
7069
use crate::types::{BlockId, TransactionId, VerificationQueueInfo as QueueInfo};
71-
use client::ConsensusClient;
7270

7371
/// Test client.
7472
pub struct TestBlockChainClient {
@@ -459,7 +457,7 @@ impl BlockChainTrait for TestBlockChainClient {
459457
None // Simple default.
460458
}
461459

462-
fn transaction_header(&self, _tracker: &Tracker) -> Option<::encoded::Header> {
460+
fn transaction_header(&self, _tracker: &Tracker) -> Option<encoded::Header> {
463461
None
464462
}
465463
}

core/src/consensus/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use crate::codechain_machine::CodeChainMachine;
5656
use crate::error::Error;
5757
use crate::transaction::UnverifiedTransaction;
5858
use crate::views::HeaderView;
59-
use Client;
59+
use crate::Client;
6060

6161
pub enum Seal {
6262
Solo,

core/src/consensus/stake/actions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use std::sync::Arc;
1818

1919
use ccrypto::Blake;
2020
use ckey::{recover, Address, Signature};
21-
use client::ConsensusClient;
2221
use ctypes::errors::SyntaxError;
2322
use ctypes::CommonParams;
2423
use primitives::{Bytes, H256};
2524
use rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream};
2625

26+
use crate::client::ConsensusClient;
2727
use crate::consensus::{ConsensusMessage, ValidatorSet};
2828

2929
const ACTION_TAG_TRANSFER_CCS: u8 = 1;
@@ -358,9 +358,9 @@ impl Decodable for Action {
358358
#[cfg(test)]
359359
mod tests {
360360
use super::*;
361+
use crate::client::TestBlockChainClient;
362+
use crate::consensus::{ConsensusMessage, DynamicValidator, Step, VoteOn, VoteStep};
361363
use ckey::sign_schnorr;
362-
use client::TestBlockChainClient;
363-
use consensus::{ConsensusMessage, DynamicValidator, Step, VoteOn, VoteStep};
364364
use ctypes::BlockHash;
365365
use rlp::rlp_encode_and_decode_test;
366366

core/src/consensus/stake/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ mod tests {
547547
use super::action_data::get_account_key;
548548
use super::*;
549549

550-
use consensus::stake::action_data::{get_delegation_key, Candidate, Prisoner};
550+
use crate::consensus::stake::action_data::{get_delegation_key, Candidate, Prisoner};
551551
use cstate::tests::helpers;
552552
use cstate::TopStateView;
553553
use rlp::Encodable;

core/src/consensus/tendermint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub use self::types::{Height, Step, View};
4141
use super::{stake, ValidatorSet};
4242
use crate::client::ConsensusClient;
4343
use crate::codechain_machine::CodeChainMachine;
44-
use ChainNotify;
44+
use crate::ChainNotify;
4545

4646
/// Timer token representing the consensus step timeouts.
4747
const ENGINE_TIMEOUT_TOKEN_NONCE_BASE: TimerToken = 23;

core/src/consensus/tendermint/vote_regression_checker.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use consensus::{Step, VoteOn};
21
use std::cmp::Ordering;
32

3+
use crate::consensus::{Step, VoteOn};
4+
45
pub struct VoteRegressionChecker {
56
last_vote: Option<VoteOn>,
67
}
@@ -41,7 +42,9 @@ impl VoteRegressionChecker {
4142
#[cfg(test)]
4243
mod tests {
4344
use super::*;
44-
use consensus::VoteStep;
45+
46+
use crate::consensus::VoteStep;
47+
4548
use primitives::H256;
4649

4750
#[test]

core/src/consensus/validator_set/dynamic_validator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ mod tests {
199199

200200
use super::super::ValidatorSet;
201201
use super::DynamicValidator;
202-
use crate::client::TestBlockChainClient;
203-
use client::ConsensusClient;
202+
use crate::client::{ConsensusClient, TestBlockChainClient};
204203

205204
#[test]
206205
fn validator_set() {

core/src/miner/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub trait MinerService: Send + Sync {
8686
fn engine_type(&self) -> EngineType;
8787

8888
/// Returns true if we had to prepare new pending block.
89-
fn prepare_work_sealing<C>(&self, &C) -> bool
89+
fn prepare_work_sealing<C>(&self, _: &C) -> bool
9090
where
9191
C: AccountData + BlockChainTrait + BlockProducer + ChainTimeInfo + EngineInfo + FindActionHandler + TermInfo;
9292

core/src/verification/queue/kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub mod headers {
9393
use crate::consensus::CodeChainEngine;
9494
use crate::error::Error;
9595
use crate::service::ClientIoMessage;
96-
use verification::verify_header_with_engine;
96+
use crate::verification::verify_header_with_engine;
9797

9898
impl BlockLike for Header {
9999
fn hash(&self) -> BlockHash {

core/src/verification/queue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,12 @@ pub struct Verifying<K: Kind> {
527527
#[cfg(test)]
528528
mod tests {
529529
use cio::IoChannel;
530-
use tests::helpers::*;
531530

532531
use super::kind::blocks::Unverified;
533532
use super::{BlockQueue, Config};
534533
use crate::error::{Error, ImportError};
535534
use crate::scheme::Scheme;
535+
use crate::tests::helpers::get_good_dummy_block;
536536

537537
// create a test block queue.
538538
// auto_scaling enables verifier adjustment.

discovery/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-discovery"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

json/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-json"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-key = { path = "../key" }

key/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-key"
33
version = "0.1.0"
44
authors = ["debris <[email protected]>", "CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
rand = "0.6.1"

key/src/private.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ use std::fmt;
1818
use std::ops::Deref;
1919
use std::str::FromStr;
2020

21-
use hex::ToHex;
2221
use primitives::H256;
2322
use secp256k1::key;
2423

24+
use crate::hex::ToHex;
2525
use crate::Error;
2626

2727
#[derive(Clone, Copy, PartialEq, Eq)]

keystore/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-keystore"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>", "Parity Technologies <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
log = "0.4.6"

keystore/src/account/safe_account.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ use ckey::{Address, KeyPair, Password};
1919

2020
use super::crypto::Crypto;
2121
use crate::account::Version;
22-
use crate::{json, Error};
23-
use DecryptedAccount;
22+
use crate::{json, DecryptedAccount, Error};
2423

2524
/// Account representation.
2625
#[derive(Debug, PartialEq, Clone)]

keystore/src/accounts_dir/disk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ where
176176

177177
// check for duplicate filename and append random suffix
178178
if dedup && keyfile_path.exists() {
179-
let suffix = ::random::random_string(4);
179+
let suffix = crate::random::random_string(4);
180180
filename.push_str(&format!("-{}", suffix));
181181
keyfile_path.set_file_name(&filename);
182182
}

network/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-network"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

rpc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-rpc"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[lib]
78

state/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-state"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

stratum/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name = "codechain-stratum"
44
version = "1.11.0"
55
license = "GPL-3.0"
66
authors = ["Parity Technologies <[email protected]>", "CodeChain Team <[email protected]>"]
7+
edition = "2018"
78

89
[dependencies]
910
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

sync/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-sync"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[lib]
78

types/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "codechain-types"
33
version = "0.1.0"
44
authors = ["CodeChain Team <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
codechain-crypto = { git = "https://github.com/CodeChain-io/rust-codechain-crypto.git", version = "0.1" }

util/error/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "util-error"
33
version = "0.1.0"
44
authors = ["Parity Technologies <[email protected]>"]
5+
edition = "2018"
56

67
[dependencies]
78
kvdb = { path = "../kvdb" }

util/hashdb/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.1"
44
authors = ["Parity Technologies <[email protected]>", "CodeChain Team <[email protected]>"]
55
description = "trait for hash-keyed databases."
66
license = "GPL-3.0"
7+
edition = "2018"
78

89
[dependencies]
910
primitives = { git = "https://github.com/CodeChain-io/rust-codechain-primitives.git", version = "0.4" }

util/io/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ license = "GPL-3.0"
55
name = "codechain-io"
66
version = "1.9.0"
77
authors = ["Parity Technologies <[email protected]>", "CodeChain Team <[email protected]>"]
8+
edition = "2018"
89

910
[dependencies]
1011
codechain-logger = { path = "../logger" }

util/io/src/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ use mio::deprecated::{EventLoop, EventLoopBuilder, Handler, Sender};
4141
use mio::timer::Timeout;
4242
use mio::*;
4343
use parking_lot::{Mutex, RwLock};
44-
use worker::{Work, WorkType, Worker};
44+
45+
use crate::worker::{Work, WorkType, Worker};
4546

4647
use super::{IoError, IoHandler};
4748

util/io/src/worker.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
1616

1717
use crossbeam::deque;
18-
use service::{IoChannel, IoContext};
1918
use std::cell::Cell;
2019
use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering};
2120
use std::sync::Arc;
2221
use std::thread::{self, JoinHandle};
23-
use IoHandler;
22+
23+
use crate::service::{IoChannel, IoContext};
24+
use crate::IoHandler;
2425

2526
use std::sync::{Condvar as SCondvar, Mutex as SMutex};
2627

util/journaldb/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "A `HashDB` which can manage a short-term journal potentially containing many forks of mutually exclusive actions"
66
license = "GPL3"
7+
edition = "2018"
78

89
[dependencies]
910
primitives = { git = "https://github.com/CodeChain-io/rust-codechain-primitives.git", version = "0.4" }

0 commit comments

Comments
 (0)