Update network and rpc to BeaconStateTypes

This commit is contained in:
Paul Hauner
2019-05-08 19:38:18 +10:00
parent 51dc97ee42
commit 42b7aa89d4
12 changed files with 70 additions and 60 deletions

View File

@@ -13,16 +13,16 @@ use slog::Logger;
use slog::{error, info, trace, warn};
use ssz::{ssz_encode, Decodable};
use std::sync::Arc;
use types::{BeaconBlock, Signature, Slot};
use types::{BeaconBlock, BeaconStateTypes, Signature, Slot};
#[derive(Clone)]
pub struct BeaconBlockServiceInstance {
pub chain: Arc<BeaconChain>,
pub struct BeaconBlockServiceInstance<B: BeaconStateTypes> {
pub chain: Arc<BeaconChain<B>>,
pub network_chan: crossbeam_channel::Sender<NetworkMessage>,
pub log: Logger,
}
impl BeaconBlockService for BeaconBlockServiceInstance {
impl<B: BeaconStateTypes> BeaconBlockService for BeaconBlockServiceInstance<B> {
/// Produce a `BeaconBlock` for signing by a validator.
fn produce_beacon_block(
&mut self,