From 9f8f2c7edf516769a672838736c23e00942fa6ef Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Thu, 5 Sep 2024 18:23:39 -0400 Subject: [PATCH] cleanup --- binaries/cuprated/src/rpc.rs | 2 -- binaries/cuprated/src/rpc/handler.rs | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/binaries/cuprated/src/rpc.rs b/binaries/cuprated/src/rpc.rs index 18ba5335..9ebcd1b8 100644 --- a/binaries/cuprated/src/rpc.rs +++ b/binaries/cuprated/src/rpc.rs @@ -2,8 +2,6 @@ //! //! Will contain the code to initiate the RPC and a request handler. -// TODO: remove after impl. - mod bin; mod handler; mod json; diff --git a/binaries/cuprated/src/rpc/handler.rs b/binaries/cuprated/src/rpc/handler.rs index ca64b950..7dbb27f9 100644 --- a/binaries/cuprated/src/rpc/handler.rs +++ b/binaries/cuprated/src/rpc/handler.rs @@ -1,6 +1,6 @@ //! Dummy implementation of [`RpcHandler`]. -use std::task::Poll; +use std::task::{Context, Poll}; use cuprate_rpc_types::{ bin::{BinRequest, BinResponse}, @@ -43,6 +43,13 @@ pub struct CupratedRpcHandlerState { pub txpool: TxpoolReadHandle, } +impl CupratedRpcHandler { + /// TODO + pub fn init() { + todo!() + } +} + impl RpcHandler for CupratedRpcHandler { fn restricted(&self) -> bool { self.restricted @@ -54,7 +61,7 @@ impl Service for CupratedRpcHandler { type Error = RpcError; type Future = BoxFuture<'static, Result>; - fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -69,7 +76,7 @@ impl Service for CupratedRpcHandler { type Error = RpcError; type Future = BoxFuture<'static, Result>; - fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } @@ -84,7 +91,7 @@ impl Service for CupratedRpcHandler { type Error = RpcError; type Future = BoxFuture<'static, Result>; - fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll> { + fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) }