mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
Modify create_proof_of_possession, and verifying proof_of_possession in process_deposits
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
use crate::beacon_chain_harness::BeaconChainHarness;
|
||||
use beacon_chain::CheckPoint;
|
||||
use bls::{create_proof_of_possession, get_withdrawal_credentials};
|
||||
use bls::get_withdrawal_credentials;
|
||||
use log::{info, warn};
|
||||
use ssz::SignedRoot;
|
||||
use std::path::Path;
|
||||
@@ -258,11 +258,19 @@ fn build_deposit(
|
||||
index_offset: u64,
|
||||
) -> (Deposit, Keypair) {
|
||||
let keypair = Keypair::random();
|
||||
let proof_of_possession = create_proof_of_possession(&keypair);
|
||||
let index = harness.beacon_chain.state.read().deposit_index + index_offset;
|
||||
let withdrawal_credentials = Hash256::from_slice(
|
||||
&get_withdrawal_credentials(&keypair.pk, harness.spec.bls_withdrawal_prefix_byte)[..],
|
||||
);
|
||||
let proof_of_possession = DepositInput::create_proof_of_possession(
|
||||
&keypair,
|
||||
&withdrawal_credentials,
|
||||
harness.spec.get_domain(
|
||||
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;
|
||||
|
||||
let deposit = Deposit {
|
||||
// Note: `branch` and `index` will need to be updated once the spec defines their
|
||||
|
||||
Reference in New Issue
Block a user