Fix clippy in test code (#993)

* fix clippy issues

* clippy + tests

* more clippy

Co-authored-by: adoerr <0xad@gmx.net>
This commit is contained in:
Svyatoslav Nikolsky
2021-06-08 17:30:13 +03:00
committed by Bastian Köcher
parent 812e782904
commit 0261d1e321
3 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -214,7 +214,7 @@ impl HeaderBuilder {
/// Helper function for getting a genesis header which has been signed by an authority.
pub fn build_genesis_header(author: &SecretKey) -> AuraHeader {
let genesis = HeaderBuilder::genesis();
genesis.header.sign_by(&author)
genesis.header.sign_by(author)
}
/// Helper function for building a custom child header which has been signed by an authority.
@@ -222,7 +222,7 @@ pub fn build_custom_header<F>(author: &SecretKey, previous: &AuraHeader, customi
where
F: FnOnce(AuraHeader) -> AuraHeader,
{
let new_header = HeaderBuilder::with_parent(&previous);
let new_header = HeaderBuilder::with_parent(previous);
let custom_header = customize_header(new_header.header);
custom_header.sign_by(author)
}
+3 -3
View File
@@ -396,7 +396,7 @@ mod tests {
fn verify_with_config(config: &AuraConfiguration, header: &AuraHeader) -> Result<ImportContext<AccountId>, Error> {
run_test_with_genesis(genesis(), TOTAL_VALIDATORS, |_| {
let storage = BridgeStorage::<TestRuntime>::new();
verify_aura_header(&storage, &config, None, header, &ConstChainTime::default())
verify_aura_header(&storage, config, None, header, &ConstChainTime::default())
})
}
@@ -787,7 +787,7 @@ mod tests {
fn pool_verifies_future_block_number() {
// when header is too far from the future
assert_eq!(
default_accept_into_pool(|validators| (HeaderBuilder::with_number(100).sign_by_set(&validators), None),),
default_accept_into_pool(|validators| (HeaderBuilder::with_number(100).sign_by_set(validators), None),),
Err(Error::UnsignedTooFarInTheFuture),
);
}
@@ -800,7 +800,7 @@ mod tests {
default_accept_into_pool(|validators| (
HeaderBuilder::with_parent_number(3)
.step(GENESIS_STEP + 3)
.sign_by_set(&validators),
.sign_by_set(validators),
None,
),),
Err(Error::DoubleVote),