mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-25 21:19:22 +00:00
cleanup
This commit is contained in:
parent
d443cfb9b7
commit
9f8f2c7edf
2 changed files with 11 additions and 6 deletions
|
@ -2,8 +2,6 @@
|
||||||
//!
|
//!
|
||||||
//! Will contain the code to initiate the RPC and a request handler.
|
//! Will contain the code to initiate the RPC and a request handler.
|
||||||
|
|
||||||
// TODO: remove after impl.
|
|
||||||
|
|
||||||
mod bin;
|
mod bin;
|
||||||
mod handler;
|
mod handler;
|
||||||
mod json;
|
mod json;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! Dummy implementation of [`RpcHandler`].
|
//! Dummy implementation of [`RpcHandler`].
|
||||||
|
|
||||||
use std::task::Poll;
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
use cuprate_rpc_types::{
|
use cuprate_rpc_types::{
|
||||||
bin::{BinRequest, BinResponse},
|
bin::{BinRequest, BinResponse},
|
||||||
|
@ -43,6 +43,13 @@ pub struct CupratedRpcHandlerState {
|
||||||
pub txpool: TxpoolReadHandle,
|
pub txpool: TxpoolReadHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl CupratedRpcHandler {
|
||||||
|
/// TODO
|
||||||
|
pub fn init() {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl RpcHandler for CupratedRpcHandler {
|
impl RpcHandler for CupratedRpcHandler {
|
||||||
fn restricted(&self) -> bool {
|
fn restricted(&self) -> bool {
|
||||||
self.restricted
|
self.restricted
|
||||||
|
@ -54,7 +61,7 @@ impl Service<JsonRpcRequest> for CupratedRpcHandler {
|
||||||
type Error = RpcError;
|
type Error = RpcError;
|
||||||
type Future = BoxFuture<'static, Result<JsonRpcResponse, RpcError>>;
|
type Future = BoxFuture<'static, Result<JsonRpcResponse, RpcError>>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
Poll::Ready(Ok(()))
|
Poll::Ready(Ok(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +76,7 @@ impl Service<BinRequest> for CupratedRpcHandler {
|
||||||
type Error = RpcError;
|
type Error = RpcError;
|
||||||
type Future = BoxFuture<'static, Result<BinResponse, RpcError>>;
|
type Future = BoxFuture<'static, Result<BinResponse, RpcError>>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
Poll::Ready(Ok(()))
|
Poll::Ready(Ok(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +91,7 @@ impl Service<OtherRequest> for CupratedRpcHandler {
|
||||||
type Error = RpcError;
|
type Error = RpcError;
|
||||||
type Future = BoxFuture<'static, Result<OtherResponse, RpcError>>;
|
type Future = BoxFuture<'static, Result<OtherResponse, RpcError>>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
Poll::Ready(Ok(()))
|
Poll::Ready(Ok(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue