declone and close the door (#12035)

* declone and close the door

* cargo fmt

* remove brackets
This commit is contained in:
Squirrel
2022-08-15 20:38:36 +01:00
committed by GitHub
parent 9c2a2495fe
commit a68a80fbae
72 changed files with 344 additions and 512 deletions
+2 -2
View File
@@ -821,7 +821,7 @@ mod tests {
block_import: client,
env: environ,
keystore: keystore.into(),
sync_oracle: DummyOracle.clone(),
sync_oracle: DummyOracle,
justification_sync_link: (),
force_authoring: false,
backoff_authoring_blocks: Some(BackoffAuthoringOnFinalizedHeadLagging::default()),
@@ -873,7 +873,7 @@ mod tests {
block_import: client.clone(),
env: environ,
keystore: keystore.into(),
sync_oracle: DummyOracle.clone(),
sync_oracle: DummyOracle,
justification_sync_link: (),
force_authoring: false,
backoff_authoring_blocks: Option::<()>::None,
@@ -310,7 +310,7 @@ mod tests {
assert!(claim_slot(10.into(), &epoch, &keystore).is_none());
epoch.authorities.push((valid_public_key.clone().into(), 10));
epoch.authorities.push((valid_public_key.into(), 10));
assert_eq!(claim_slot(10.into(), &epoch, &keystore).unwrap().1, valid_public_key.into());
}
}
+1 -1
View File
@@ -152,7 +152,7 @@ impl DummyProposer {
// that will re-check the randomness logic off-chain.
let digest_data = ConsensusLog::NextEpochData(NextEpochDescriptor {
authorities: epoch.authorities.clone(),
randomness: epoch.randomness.clone(),
randomness: epoch.randomness,
})
.encode();
let digest = DigestItem::Consensus(BABE_ENGINE_ID, digest_data);
@@ -535,7 +535,7 @@ mod tests {
_number: BlockNumber,
_success: bool,
) {
self.events.push(Event::JustificationImported(hash.clone()))
self.events.push(Event::JustificationImported(*hash))
}
}
+8 -8
View File
@@ -1063,7 +1063,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_a_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"A", 1, *b"0", incremented_epoch)
@@ -1080,7 +1080,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_x_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"X", 1, *b"0", incremented_epoch)
@@ -1145,7 +1145,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_a_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"A", 1, *b"0", incremented_epoch)
@@ -1162,7 +1162,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_x_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"X", 1, *b"0", incremented_epoch)
@@ -1220,7 +1220,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_a_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"1", 1, *b"0", incremented_epoch)
@@ -1330,7 +1330,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_a_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"A", 1, *b"0", incremented_epoch)
@@ -1347,7 +1347,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&epoch_b_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"B", 201, *b"A", incremented_epoch)
@@ -1364,7 +1364,7 @@ mod tests {
let incremented_epoch = epoch_changes
.viable_epoch(&genesis_epoch_x_descriptor, &make_genesis)
.unwrap()
.increment(next_descriptor.clone());
.increment(next_descriptor);
epoch_changes
.import(&is_descendent_of, *b"C", 1, *b"0", incremented_epoch)
@@ -355,7 +355,7 @@ mod tests {
assert_eq!(
created_block,
CreatedBlock {
hash: created_block.hash.clone(),
hash: created_block.hash,
aux: ImportedAux {
header_only: false,
clear_justification_requests: false,
@@ -422,7 +422,7 @@ mod tests {
assert_eq!(
created_block,
CreatedBlock {
hash: created_block.hash.clone(),
hash: created_block.hash,
aux: ImportedAux {
header_only: false,
clear_justification_requests: false,
@@ -502,7 +502,7 @@ mod tests {
assert_eq!(
created_block,
CreatedBlock {
hash: created_block.hash.clone(),
hash: created_block.hash,
aux: ImportedAux {
header_only: false,
clear_justification_requests: false,