mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
added protos specification for Attester and created first draft for attestation_grpc_client (lighthouse-255)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
mod attestation_grpc_client;
|
||||
use attester::{Attester, BeaconNode, DutiesReader, PollOutcome as AttesterPollOutcome, Signer};
|
||||
use slog::Logger;
|
||||
use slog::{error, info, warn, Logger};
|
||||
use slot_clock::SlotClock;
|
||||
use std::time::Duration;
|
||||
|
||||
pub use self::attestation_grpc_client::AttestationGrpcClient;
|
||||
|
||||
pub struct AttesterService<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> {
|
||||
pub attester: Attester<T, U, V, W>,
|
||||
pub poll_interval_millis: u64,
|
||||
|
||||
Reference in New Issue
Block a user