added protos specification for Attester and created first draft for attestation_grpc_client (lighthouse-255)

This commit is contained in:
thojest
2019-03-15 11:44:39 +01:00
parent e02bc82b6a
commit 2215aa4b46
4 changed files with 97 additions and 8 deletions

View File

@@ -0,0 +1,32 @@
use protos::services_grpc::AttestationServiceClient;
use std::sync::Arc;
use attester::{BeaconNode, BeaconNodeError, PublishOutcome};
use types::{AttestationData, FreeAttestation, Slot};
pub struct AttestationGrpcClient {
client: Arc<AttestationServiceClient>,
}
impl AttestationGrpcClient {
pub fn new(client: Arc<AttestationServiceClient>) -> Self {
Self { client }
}
}
impl BeaconNode for AttestationGrpcClient {
fn produce_attestation_data(
&self,
slot: Slot,
shard: u64,
) -> Result<Option<AttestationData>, BeaconNodeError> {
Err(BeaconNodeError::DecodeFailure)
}
fn publish_attestation_data(
&self,
free_attestation: FreeAttestation,
) -> Result<PublishOutcome, BeaconNodeError> {
Err(BeaconNodeError::DecodeFailure)
}
}