mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 04:13:00 +00:00
Fix various clippy lints
This commit is contained in:
@@ -61,8 +61,7 @@ impl BeaconChainHarness {
|
||||
|
||||
debug!("Creating validator deposits...");
|
||||
|
||||
let mut initial_validator_deposits = Vec::with_capacity(validator_count);
|
||||
initial_validator_deposits = keypairs
|
||||
let initial_validator_deposits = keypairs
|
||||
.par_iter()
|
||||
.map(|keypair| Deposit {
|
||||
branch: vec![], // branch verification is not specified.
|
||||
@@ -235,7 +234,7 @@ impl BeaconChainHarness {
|
||||
}
|
||||
|
||||
/// Write the output of `chain_dump` to a JSON file.
|
||||
pub fn dump_to_file(&self, filename: String, chain_dump: &Vec<CheckPoint>) {
|
||||
pub fn dump_to_file(&self, filename: String, chain_dump: &[CheckPoint]) {
|
||||
let json = serde_json::to_string(chain_dump).unwrap();
|
||||
let mut file = File::create(filename).unwrap();
|
||||
file.write_all(json.as_bytes())
|
||||
|
||||
@@ -80,7 +80,7 @@ impl<T: ClientDB, U: SlotClock> BeaconBlockNode for DirectBeaconNode<T, U> {
|
||||
.beacon_chain
|
||||
.produce_block(randao_reveal.clone())
|
||||
.ok_or_else(|| {
|
||||
BeaconBlockNodeError::RemoteFailure(format!("Did not produce block."))
|
||||
BeaconBlockNodeError::RemoteFailure("Did not produce block.".to_string())
|
||||
})?;
|
||||
|
||||
if block.slot == slot {
|
||||
|
||||
@@ -60,7 +60,7 @@ impl<T: ClientDB, U: SlotClock> AttesterDutiesReader for DirectDuties<T, U> {
|
||||
}
|
||||
Ok(Some(_)) => Ok(None),
|
||||
Ok(None) => Err(AttesterDutiesReaderError::UnknownEpoch),
|
||||
Err(_) => panic!("Error when getting validator attestation shard."),
|
||||
Err(_) => unreachable!("Error when getting validator attestation shard."),
|
||||
}
|
||||
} else {
|
||||
Err(AttesterDutiesReaderError::UnknownValidator)
|
||||
|
||||
@@ -25,7 +25,7 @@ impl BeaconBlockService for BeaconBlockServiceInstance {
|
||||
// TODO: build a legit block.
|
||||
let mut block = BeaconBlockProto::new();
|
||||
block.set_slot(req.get_slot());
|
||||
block.set_block_root("cats".as_bytes().to_vec());
|
||||
block.set_block_root(b"cats".to_vec());
|
||||
|
||||
let mut resp = ProduceBeaconBlockResponse::new();
|
||||
resp.set_block(block);
|
||||
|
||||
Reference in New Issue
Block a user