Skip to content

Commit 6295dff

Browse files
authored
chore: remove unused RPC methods (#21)
1 parent 8bde98a commit 6295dff

File tree

7 files changed

+7
-250
lines changed

7 files changed

+7
-250
lines changed

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/net/control.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use crate::{
1111
drand::{
1212
control_client::ControlClient as ControlClientInner,
1313
control_server::{Control, ControlServer},
14-
ChainInfoPacket, ChainInfoRequest, ListSchemesRequest, ListSchemesResponse,
15-
LoadBeaconRequest, LoadBeaconResponse, Metadata, ShutdownRequest, ShutdownResponse,
16-
StartSyncRequest, StatusRequest, StatusResponse, SyncProgress,
14+
ChainInfoPacket, ChainInfoRequest, LoadBeaconRequest, LoadBeaconResponse, Metadata,
15+
ShutdownRequest, ShutdownResponse, StartSyncRequest, StatusRequest, StatusResponse,
16+
SyncProgress,
1717
},
1818
},
1919
};
@@ -73,14 +73,6 @@ impl Control for ControlHandler {
7373
Ok(Response::new(status))
7474
}
7575

76-
/// ListSchemes responds with the list of ids for the available schemes.
77-
async fn list_schemes(
78-
&self,
79-
_request: Request<ListSchemesRequest>,
80-
) -> Result<Response<ListSchemesResponse>, Status> {
81-
Err(Status::unimplemented("list_schemes: ListSchemesRequest"))
82-
}
83-
8476
/// ChainInfo returns the chain info for the chain hash or beacon id requested in the metadata.
8577
async fn chain_info(
8678
&self,

src/net/public.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use crate::{
44
core::{beacon::BeaconCmd, daemon::Daemon},
55
protobuf::drand::{
66
public_client::PublicClient as PublicClientInner, public_server::Public, ChainInfoPacket,
7-
ChainInfoRequest, ListBeaconIDsRequest, ListBeaconIDsResponse, Metadata, PublicRandRequest,
8-
PublicRandResponse,
7+
ChainInfoRequest, Metadata, PublicRandRequest, PublicRandResponse,
98
},
109
};
1110
use anyhow::{bail, Context};
@@ -29,15 +28,15 @@ impl Public for PublicHandler {
2928
/// Server streaming response type for the `public_rand_stream` method.
3029
type PublicRandStreamStream = ResponseStream;
3130

32-
/// TODO: implement if we need to support relays in same way.
31+
/// TODO: https://github.com/drand/http-relay/blob/master/grpc/grpc.go#L119
3332
async fn public_rand(
3433
&self,
3534
_request: Request<PublicRandRequest>,
3635
) -> Result<Response<PublicRandResponse>, Status> {
3736
Err(Status::unimplemented("public_rand: PublicRandRequest"))
3837
}
3938

40-
/// TODO: implement if we need to support relays in same way.
39+
/// TODO: https://github.com/drand/http-relay/blob/master/grpc/grpc.go#L141
4140
async fn public_rand_stream(
4241
&self,
4342
_request: Request<PublicRandRequest>,
@@ -69,16 +68,6 @@ impl Public for PublicHandler {
6968

7069
Ok(Response::new(chain_info))
7170
}
72-
73-
// TODO: this method required.
74-
async fn list_beacon_i_ds(
75-
&self,
76-
_request: Request<ListBeaconIDsRequest>,
77-
) -> Result<Response<ListBeaconIDsResponse>, Status> {
78-
Err(Status::unimplemented(
79-
"list_beacon_i_ds: ListBeaconIDsRequest",
80-
))
81-
}
8271
}
8372

8473
pub struct PublicClient {

src/protobuf/api.proto

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/protobuf/control.proto

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/protobuf/drand.rs

Lines changed: 0 additions & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/transport/drand.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,35 +112,6 @@ impl From<Node> for crate::protobuf::drand::Node {
112112
}
113113
}
114114

115-
pub struct ListSchemesResponse {
116-
pub ids: Vec<String>,
117-
pub metadata: Metadata,
118-
}
119-
120-
impl ConvertProto for crate::protobuf::drand::ListSchemesResponse {
121-
type Inner = ListSchemesResponse;
122-
123-
fn validate(self) -> Result<Self::Inner, TransportError> {
124-
let Self { ids, metadata } = self;
125-
126-
Ok(Self::Inner {
127-
ids,
128-
metadata: metadata.require_some()?,
129-
})
130-
}
131-
}
132-
133-
impl From<ListSchemesResponse> for crate::protobuf::drand::ListSchemesResponse {
134-
fn from(value: ListSchemesResponse) -> Self {
135-
let ListSchemesResponse { ids, metadata } = value;
136-
137-
Self {
138-
ids,
139-
metadata: Some(metadata),
140-
}
141-
}
142-
}
143-
144115
pub struct StartSyncRequest {
145116
pub nodes: Vec<String>,
146117
pub up_to: u64,

0 commit comments

Comments
 (0)