mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 12:28:24 +00:00
Run cargo fmt
This commit is contained in:
@@ -118,12 +118,16 @@ impl BeaconChainHarness {
|
||||
let deposits = generate_deposits_from_keypairs(
|
||||
&keypairs,
|
||||
genesis_time,
|
||||
spec.get_domain(spec.genesis_epoch, Domain::Deposit, &Fork{
|
||||
previous_version: spec.genesis_fork_version,
|
||||
current_version: spec.genesis_fork_version,
|
||||
epoch: spec.genesis_epoch,
|
||||
}),
|
||||
&spec
|
||||
spec.get_domain(
|
||||
spec.genesis_epoch,
|
||||
Domain::Deposit,
|
||||
&Fork {
|
||||
previous_version: spec.genesis_fork_version,
|
||||
current_version: spec.genesis_fork_version,
|
||||
epoch: spec.genesis_epoch,
|
||||
},
|
||||
),
|
||||
&spec,
|
||||
);
|
||||
state_builder.process_initial_deposits(&deposits, &spec);
|
||||
};
|
||||
|
||||
@@ -42,28 +42,32 @@ pub fn generate_deposits_from_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),
|
||||
},
|
||||
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();
|
||||
},
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
initial_validator_deposits
|
||||
}
|
||||
|
||||
@@ -265,10 +265,14 @@ fn build_deposit(
|
||||
&keypair,
|
||||
&withdrawal_credentials,
|
||||
harness.spec.get_domain(
|
||||
harness.beacon_chain.state.read().current_epoch(&harness.spec),
|
||||
harness
|
||||
.beacon_chain
|
||||
.state
|
||||
.read()
|
||||
.current_epoch(&harness.spec),
|
||||
Domain::Deposit,
|
||||
&harness.beacon_chain.state.read().fork,
|
||||
)
|
||||
),
|
||||
);
|
||||
let index = harness.beacon_chain.state.read().deposit_index + index_offset;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user