Add changes of create_proof_of_possession to pull

This commit is contained in:
Kirk Baird 2019-03-11 11:55:09 +11:00
parent 0b7082e2b9
commit df52669888
No known key found for this signature in database
GPG Key ID: BF864B7ED0BEA33F
2 changed files with 3 additions and 2 deletions

View File

@ -108,7 +108,7 @@ fn main() {
deposit_input: DepositInput { deposit_input: DepositInput {
pubkey: keypair.pk.clone(), pubkey: keypair.pk.clone(),
withdrawal_credentials: Hash256::zero(), // Withdrawal not possible. withdrawal_credentials: Hash256::zero(), // Withdrawal not possible.
proof_of_possession: create_proof_of_possession(&keypair), proof_of_possession: create_proof_of_possession(&keypair, Hash256::zero()),
}, },
}, },
}) })

View File

@ -20,6 +20,7 @@ pub const BLS_AGG_SIG_BYTE_SIZE: usize = 96;
use hashing::hash; use hashing::hash;
use ssz::ssz_encode; use ssz::ssz_encode;
use types::{DepositInput, Hash256};
/// For some signature and public key, ensure that the signature message was the public key and it /// For some signature and public key, ensure that the signature message was the public key and it
/// was signed by the secret key that corresponds to that public key. /// was signed by the secret key that corresponds to that public key.
@ -31,7 +32,7 @@ pub fn verify_proof_of_possession(sig: &Signature, pubkey: &PublicKey) -> bool {
// TODO: Update this method // TODO: Update this method
// https://github.com/sigp/lighthouse/issues/239 // https://github.com/sigp/lighthouse/issues/239
pub fn create_proof_of_possession(keypair: &Keypair) -> Signature { pub fn create_proof_of_possession(keypair: &Keypair, withdrawal_credentials: &Hash256) -> Signature {
Signature::new(&ssz_encode(&keypair.pk), 0, &keypair.sk) Signature::new(&ssz_encode(&keypair.pk), 0, &keypair.sk)
} }