diff --git a/beacon_node/beacon_chain/test_harness/src/beacon_chain_harness.rs b/beacon_node/beacon_chain/test_harness/src/beacon_chain_harness.rs index 43b60d506..f0fcad5cc 100644 --- a/beacon_node/beacon_chain/test_harness/src/beacon_chain_harness.rs +++ b/beacon_node/beacon_chain/test_harness/src/beacon_chain_harness.rs @@ -243,6 +243,25 @@ impl BeaconChainHarness { debug!("Free attestations processed."); } + pub fn validator_sign( + &self, + validator_index: usize, + message: &[u8], + epoch: Epoch, + domain_type: u64, + ) -> Option { + let validator = self.validators.get(validator_index)?; + + let domain = self + .beacon_chain + .state + .read() + .fork + .get_domain(epoch, domain_type); + + Some(Signature::new(message, domain, &validator.keypair.sk)) + } + pub fn add_deposit(&mut self, deposit: Deposit, keypair: Option) { self.beacon_chain.receive_deposit_for_inclusion(deposit);