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

@@ -5,14 +5,15 @@ use protos::services::{Empty, Fork, NodeInfoResponse};
use protos::services_grpc::BeaconNodeService;
use slog::{trace, warn};
use std::sync::Arc;
use types::BeaconStateTypes;
#[derive(Clone)]
pub struct BeaconNodeServiceInstance {
pub chain: Arc<BeaconChain>,
pub struct BeaconNodeServiceInstance<B: BeaconStateTypes> {
pub chain: Arc<BeaconChain<B>>,
pub log: slog::Logger,
}
impl BeaconNodeService for BeaconNodeServiceInstance {
impl<B: BeaconStateTypes> BeaconNodeService for BeaconNodeServiceInstance<B> {
/// Provides basic node information.
fn info(&mut self, ctx: RpcContext, _req: Empty, sink: UnarySink<NodeInfoResponse>) {
trace!(self.log, "Node info requested via RPC");