mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-12 02:14:10 +00:00
Add attester to beacon chain test harness
This commit is contained in:
@@ -131,7 +131,7 @@ impl<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> Attester<T, U, V,
|
||||
self.store_produce(attestation_data);
|
||||
|
||||
self.signer
|
||||
.bls_sign(&attestation_data.signable_message(PHASE_0_CUSTODY_BIT)[..])
|
||||
.sign_attestation_message(&attestation_data.signable_message(PHASE_0_CUSTODY_BIT)[..])
|
||||
}
|
||||
|
||||
/// Returns `true` if signing some attestation_data is safe (non-slashable).
|
||||
|
||||
@@ -25,7 +25,7 @@ impl TestSigner {
|
||||
}
|
||||
|
||||
impl Signer for TestSigner {
|
||||
fn bls_sign(&self, message: &[u8]) -> Option<Signature> {
|
||||
fn sign_attestation_message(&self, message: &[u8]) -> Option<Signature> {
|
||||
Some(Signature::new(message, &self.keypair.sk))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,5 +47,5 @@ pub trait DutiesReader: Send + Sync {
|
||||
|
||||
/// Signs message using an internally-maintained private key.
|
||||
pub trait Signer {
|
||||
fn bls_sign(&self, message: &[u8]) -> Option<Signature>;
|
||||
fn sign_attestation_message(&self, message: &[u8]) -> Option<Signature>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user