Fix clippy warnings
This commit is contained in:
parent
2bfc8ed4da
commit
8cc89b9820
@ -12,14 +12,9 @@ use slot_clock::TestingSlotClock;
|
||||
use ssz::TreeHash;
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use types::{test_utils::TestingBeaconStateBuilder, *};
|
||||
|
||||
mod generate_deposits;
|
||||
|
||||
pub use generate_deposits::generate_deposits_from_keypairs;
|
||||
|
||||
/// The beacon chain harness simulates a single beacon node with `validator_count` validators connected
|
||||
/// to it. Each validator is provided a borrow to the beacon chain, where it may read
|
||||
/// information and submit blocks/attestations for processing.
|
||||
|
@ -1,46 +0,0 @@
|
||||
use bls::get_withdrawal_credentials;
|
||||
use log::debug;
|
||||
use rayon::prelude::*;
|
||||
use types::*;
|
||||
|
||||
/// Generates a `Deposit` for each keypairs
|
||||
pub fn generate_deposits_from_keypairs(
|
||||
keypairs: &[Keypair],
|
||||
genesis_time: u64,
|
||||
domain: u64,
|
||||
spec: &ChainSpec,
|
||||
) -> Vec<Deposit> {
|
||||
debug!(
|
||||
"Generating {} validator deposits from random keypairs...",
|
||||
keypairs.len()
|
||||
);
|
||||
|
||||
let initial_validator_deposits = keypairs
|
||||
.par_iter()
|
||||
.map(|keypair| {
|
||||
let withdrawal_credentials = Hash256::from_slice(
|
||||
&get_withdrawal_credentials(&keypair.pk, spec.bls_withdrawal_prefix_byte)[..],
|
||||
);
|
||||
Deposit {
|
||||
branch: vec![], // branch verification is not specified.
|
||||
index: 0, // index verification is not specified.
|
||||
deposit_data: DepositData {
|
||||
amount: 32_000_000_000, // 32 ETH (in Gwei)
|
||||
timestamp: genesis_time - 1,
|
||||
deposit_input: DepositInput {
|
||||
pubkey: keypair.pk.clone(),
|
||||
// Validator can withdraw using their main keypair.
|
||||
withdrawal_credentials: withdrawal_credentials.clone(),
|
||||
proof_of_possession: DepositInput::create_proof_of_possession(
|
||||
&keypair,
|
||||
&withdrawal_credentials,
|
||||
domain,
|
||||
),
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
initial_validator_deposits
|
||||
}
|
@ -6,7 +6,6 @@ use beacon_chain::CheckPoint;
|
||||
use bls::get_withdrawal_credentials;
|
||||
use log::{info, warn};
|
||||
use ssz::SignedRoot;
|
||||
use std::path::Path;
|
||||
use types::*;
|
||||
|
||||
use types::test_utils::{TestingAttesterSlashingBuilder, TestingProposerSlashingBuilder};
|
||||
|
Loading…
Reference in New Issue
Block a user