Remove unused var from block_producer

It was made redundant when `proposer_slots` was removed.
This commit is contained in:
Paul Hauner 2019-02-13 07:39:00 +11:00
parent 5c1d0dcea5
commit 05ed778ccc
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
3 changed files with 2 additions and 9 deletions

View File

@ -70,7 +70,6 @@ impl ValidatorHarness {
let block_producer = BlockProducer::new(
spec.clone(),
keypair.pk.clone(),
epoch_map.clone(),
slot_clock.clone(),
beacon_node.clone(),

View File

@ -4,7 +4,7 @@ mod traits;
use slot_clock::SlotClock;
use ssz::ssz_encode;
use std::sync::Arc;
use types::{BeaconBlock, ChainSpec, PublicKey, Slot};
use types::{BeaconBlock, ChainSpec, Slot};
pub use self::traits::{
BeaconNode, BeaconNodeError, DutiesReader, DutiesReaderError, PublishOutcome, Signer,
@ -48,7 +48,6 @@ pub enum Error {
/// Relies upon an external service to keep the `EpochDutiesMap` updated.
pub struct BlockProducer<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> {
pub last_processed_slot: Option<Slot>,
pubkey: PublicKey,
spec: Arc<ChainSpec>,
epoch_map: Arc<V>,
slot_clock: Arc<T>,
@ -60,7 +59,6 @@ impl<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> BlockProducer<T, U
/// Returns a new instance where `last_processed_slot == 0`.
pub fn new(
spec: Arc<ChainSpec>,
pubkey: PublicKey,
epoch_map: Arc<V>,
slot_clock: Arc<T>,
beacon_node: Arc<U>,
@ -68,7 +66,6 @@ impl<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> BlockProducer<T, U
) -> Self {
Self {
last_processed_slot: None,
pubkey,
spec,
epoch_map,
slot_clock,
@ -238,11 +235,9 @@ mod tests {
let produce_epoch = produce_slot.epoch(spec.epoch_length);
epoch_map.map.insert(produce_epoch, produce_slot);
let epoch_map = Arc::new(epoch_map);
let keypair = Keypair::random();
let mut block_producer = BlockProducer::new(
spec.clone(),
keypair.pk.clone(),
epoch_map.clone(),
slot_clock.clone(),
beacon_node.clone(),

View File

@ -142,7 +142,6 @@ fn main() {
// Spawn a new thread to perform block production for the validator.
let producer_thread = {
let spec = spec.clone();
let pubkey = keypair.pk.clone();
let signer = Arc::new(LocalSigner::new(keypair.clone()));
let duties_map = duties_map.clone();
let slot_clock = slot_clock.clone();
@ -150,7 +149,7 @@ fn main() {
let client = Arc::new(BeaconBlockGrpcClient::new(beacon_block_grpc_client.clone()));
thread::spawn(move || {
let block_producer =
BlockProducer::new(spec, pubkey, duties_map, slot_clock, client, signer);
BlockProducer::new(spec, duties_map, slot_clock, client, signer);
let mut block_producer_service = BlockProducerService {
block_producer,
poll_interval_millis,