Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
chore: clean a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
seerscode committed May 7, 2019
1 parent b43f8b2 commit 1ccf396
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
1 change: 0 additions & 1 deletion core/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ tokio = "0.1.7"
parking_lot = "0.7.1"
error-chain = "0.12"
log = "0.4"
hex-literal = "0.1.0"

[dev-dependencies]
keyring = { package = "substrate-keyring", path = "../../keyring" }
Expand Down
11 changes: 4 additions & 7 deletions core/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ mod tests {
use test_client;
use primitives::hash::H256;
use runtime_primitives::testing::{Header as HeaderTest, Digest as DigestTest, Block as RawBlock, ExtrinsicWrapper};
use hex_literal::*;
use slots::MAX_SLOT_CAPACITY;


Expand Down Expand Up @@ -921,12 +920,11 @@ mod tests {
}

fn create_header(slot_num: u64, number: u64, pair: &sr25519::Pair) -> (HeaderTest, H256) {
// Construct one header.
let mut header = HeaderTest {
parent_hash: [69u8; 32].into(),
parent_hash: Default::default(),
number,
state_root: hex!("49cd58a254ccf6abc4a023d9a22dcfc421e385527a250faec69f8ad0d8ed3e48").into(),
extrinsics_root: hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(),
state_root: Default::default(),
extrinsics_root: Default::default(),
digest: DigestTest { logs: vec![], },
};
let header_hash: H256 = header.hash();
Expand Down Expand Up @@ -1041,7 +1039,6 @@ mod tests {
type B = RawBlock<ExtrinsicWrapper<u64>>;
type P = sr25519::Pair;
let high_slot = 2000;
// let authorities2 = authorities(&client, &BlockId::Number(3)).unwrap();

let c = Arc::new(client);

Expand All @@ -1052,7 +1049,7 @@ mod tests {
// But not two different headers at the same slot.
assert!(check_header::<_, B, P>(&c, high_slot, header2, header2_hash, &authorities, false).is_err());

// We should ignore old slot headers (out of MAX_SLOT_CAPACITY).
// We should ignore old slot headers.
assert!(check_header::<_, B, P>(&c, high_slot, header3, header3_hash, &authorities, false).is_ok());
}
}
1 change: 0 additions & 1 deletion core/consensus/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ log = "0.4.6"
schnorrkel = "0.1.1"
rand = "0.6.5"
merlin = "1.0.3"
hex-literal = "0.1.0"

[dev-dependencies]
keyring = { package = "substrate-keyring", path = "../../keyring" }
Expand Down
10 changes: 4 additions & 6 deletions core/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,6 @@ mod tests {
use test_client::AuthorityKeyring;
use primitives::hash::H256;
use runtime_primitives::testing::{Header as HeaderTest, Digest as DigestTest, Block as RawBlock, ExtrinsicWrapper};
use hex_literal::*;
use slots::MAX_SLOT_CAPACITY;


Expand Down Expand Up @@ -991,12 +990,11 @@ mod tests {
}

fn create_header(slot_num: u64, number: u64, pair: &sr25519::Pair) -> (HeaderTest, H256) {
// Construct one header.
let mut header = HeaderTest {
parent_hash: [69u8; 32].into(),
parent_hash: Default::default(),
number,
state_root: hex!("49cd58a254ccf6abc4a023d9a22dcfc421e385527a250faec69f8ad0d8ed3e48").into(),
extrinsics_root: hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(),
state_root: Default::default(),
extrinsics_root: Default::default(),
digest: DigestTest { logs: vec![], },
};

Expand Down Expand Up @@ -1186,7 +1184,7 @@ mod tests {
// But not two different headers at the same slot.
assert!(check_header::<B, _>(&c, high_slot, header2, header2_hash, &authorities, max).is_err());

// We should ignore old slot headers (out of MAX_SLOT_CAPACITY).
// We should ignore old slot headers.
assert!(check_header::<B, _>(&c, high_slot, header3, header3_hash, &authorities, max).is_ok());
}
}

0 comments on commit 1ccf396

Please sign in to comment.