mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Tidy signing, reduce ForkService duplication
This commit is contained in:
@@ -100,6 +100,13 @@ impl<T: EthSpec> BeaconBlock<T> {
|
||||
..self.block_header()
|
||||
}
|
||||
}
|
||||
|
||||
/// Signs `self`.
|
||||
pub fn sign(&mut self, secret_key: &SecretKey, fork: &Fork, spec: &ChainSpec) {
|
||||
let message = self.signed_root();
|
||||
let domain = spec.get_domain(self.epoch(), Domain::BeaconProposer, &fork);
|
||||
self.signature = Signature::new(&message, domain, &secret_key);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user