cuprated: update error type
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled

This commit is contained in:
hinto.janai 2024-09-06 20:09:42 -04:00
parent aac1a31bed
commit 6b16fb5688
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
6 changed files with 89 additions and 78 deletions

9
Cargo.lock generated
View file

@ -56,6 +56,12 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
[[package]]
name = "anyhow"
version = "1.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8"
[[package]] [[package]]
name = "async-stream" name = "async-stream"
version = "0.3.5" version = "0.3.5"
@ -799,6 +805,7 @@ dependencies = [
name = "cuprate-rpc-interface" name = "cuprate-rpc-interface"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"anyhow",
"axum", "axum",
"cuprate-epee-encoding", "cuprate-epee-encoding",
"cuprate-helper", "cuprate-helper",
@ -809,7 +816,6 @@ dependencies = [
"paste", "paste",
"serde", "serde",
"serde_json", "serde_json",
"thiserror",
"tokio", "tokio",
"tower", "tower",
"ureq", "ureq",
@ -910,6 +916,7 @@ dependencies = [
name = "cuprated" name = "cuprated"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow",
"async-trait", "async-trait",
"bitflags 2.5.0", "bitflags 2.5.0",
"borsh", "borsh",

View file

@ -35,6 +35,7 @@ cuprate-rpc-interface = { path = "../../rpc/interface" }
cuprate-rpc-types = { path = "../../rpc/types" } cuprate-rpc-types = { path = "../../rpc/types" }
# TODO: after v1.0.0, remove unneeded dependencies. # TODO: after v1.0.0, remove unneeded dependencies.
anyhow = { workspace = true }
async-trait = { workspace = true } async-trait = { workspace = true }
bitflags = { workspace = true } bitflags = { workspace = true }
borsh = { workspace = true } borsh = { workspace = true }

View file

@ -1,4 +1,5 @@
use cuprate_rpc_interface::RpcError; use anyhow::Error;
use cuprate_rpc_types::{ use cuprate_rpc_types::{
bin::{ bin::{
BinRequest, BinResponse, GetBlocksByHeightRequest, GetBlocksByHeightResponse, BinRequest, BinResponse, GetBlocksByHeightRequest, GetBlocksByHeightResponse,
@ -15,7 +16,7 @@ use crate::rpc::CupratedRpcHandlerState;
pub(super) async fn map_request( pub(super) async fn map_request(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: BinRequest, request: BinRequest,
) -> Result<BinResponse, RpcError> { ) -> Result<BinResponse, Error> {
use BinRequest as Req; use BinRequest as Req;
use BinResponse as Resp; use BinResponse as Resp;
@ -37,48 +38,48 @@ pub(super) async fn map_request(
async fn get_blocks( async fn get_blocks(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlocksRequest, request: GetBlocksRequest,
) -> Result<GetBlocksResponse, RpcError> { ) -> Result<GetBlocksResponse, Error> {
todo!() todo!()
} }
async fn get_blocks_by_height( async fn get_blocks_by_height(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlocksByHeightRequest, request: GetBlocksByHeightRequest,
) -> Result<GetBlocksByHeightResponse, RpcError> { ) -> Result<GetBlocksByHeightResponse, Error> {
todo!() todo!()
} }
async fn get_hashes( async fn get_hashes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetHashesRequest, request: GetHashesRequest,
) -> Result<GetHashesResponse, RpcError> { ) -> Result<GetHashesResponse, Error> {
todo!() todo!()
} }
async fn get_output_indexes( async fn get_output_indexes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetOutputIndexesRequest, request: GetOutputIndexesRequest,
) -> Result<GetOutputIndexesResponse, RpcError> { ) -> Result<GetOutputIndexesResponse, Error> {
todo!() todo!()
} }
async fn get_outs( async fn get_outs(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetOutsRequest, request: GetOutsRequest,
) -> Result<GetOutsResponse, RpcError> { ) -> Result<GetOutsResponse, Error> {
todo!() todo!()
} }
async fn get_transaction_pool_hashes( async fn get_transaction_pool_hashes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionPoolHashesRequest, request: GetTransactionPoolHashesRequest,
) -> Result<GetTransactionPoolHashesResponse, RpcError> { ) -> Result<GetTransactionPoolHashesResponse, Error> {
todo!() todo!()
} }
async fn get_output_distribution( async fn get_output_distribution(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetOutputDistributionRequest, request: GetOutputDistributionRequest,
) -> Result<GetOutputDistributionResponse, RpcError> { ) -> Result<GetOutputDistributionResponse, Error> {
todo!() todo!()
} }

View file

@ -2,6 +2,7 @@
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use anyhow::Error;
use futures::{channel::oneshot::channel, future::BoxFuture}; use futures::{channel::oneshot::channel, future::BoxFuture};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tower::Service; use tower::Service;
@ -9,7 +10,7 @@ use tower::Service;
use cuprate_blockchain::service::BlockchainReadHandle; use cuprate_blockchain::service::BlockchainReadHandle;
use cuprate_helper::asynch::InfallibleOneshotReceiver; use cuprate_helper::asynch::InfallibleOneshotReceiver;
use cuprate_json_rpc::Id; use cuprate_json_rpc::Id;
use cuprate_rpc_interface::{RpcError, RpcHandler}; use cuprate_rpc_interface::RpcHandler;
use cuprate_rpc_types::{ use cuprate_rpc_types::{
bin::{BinRequest, BinResponse}, bin::{BinRequest, BinResponse},
json::{JsonRpcRequest, JsonRpcResponse}, json::{JsonRpcRequest, JsonRpcResponse},
@ -58,8 +59,8 @@ impl RpcHandler for CupratedRpcHandler {
impl Service<JsonRpcRequest> for CupratedRpcHandler { impl Service<JsonRpcRequest> for CupratedRpcHandler {
type Response = JsonRpcResponse; type Response = JsonRpcResponse;
type Error = RpcError; type Error = Error;
type Future = BoxFuture<'static, Result<JsonRpcResponse, RpcError>>; type Future = BoxFuture<'static, Result<JsonRpcResponse, Error>>;
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))
@ -73,8 +74,8 @@ impl Service<JsonRpcRequest> for CupratedRpcHandler {
impl Service<BinRequest> for CupratedRpcHandler { impl Service<BinRequest> for CupratedRpcHandler {
type Response = BinResponse; type Response = BinResponse;
type Error = RpcError; type Error = Error;
type Future = BoxFuture<'static, Result<BinResponse, RpcError>>; type Future = BoxFuture<'static, Result<BinResponse, Error>>;
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))
@ -88,8 +89,8 @@ impl Service<BinRequest> for CupratedRpcHandler {
impl Service<OtherRequest> for CupratedRpcHandler { impl Service<OtherRequest> for CupratedRpcHandler {
type Response = OtherResponse; type Response = OtherResponse;
type Error = RpcError; type Error = Error;
type Future = BoxFuture<'static, Result<OtherResponse, RpcError>>; type Future = BoxFuture<'static, Result<OtherResponse, Error>>;
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(())) Poll::Ready(Ok(()))

View file

@ -1,8 +1,8 @@
use std::sync::Arc; use std::sync::Arc;
use anyhow::Error;
use tower::ServiceExt; use tower::ServiceExt;
use cuprate_rpc_interface::RpcError;
use cuprate_rpc_types::json::{ use cuprate_rpc_types::json::{
AddAuxPowRequest, AddAuxPowResponse, BannedRequest, BannedResponse, CalcPowRequest, AddAuxPowRequest, AddAuxPowResponse, BannedRequest, BannedResponse, CalcPowRequest,
CalcPowResponse, FlushCacheRequest, FlushCacheResponse, FlushTransactionPoolRequest, CalcPowResponse, FlushCacheRequest, FlushCacheResponse, FlushTransactionPoolRequest,
@ -29,7 +29,7 @@ use crate::rpc::CupratedRpcHandlerState;
pub(super) async fn map_request( pub(super) async fn map_request(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: JsonRpcRequest, request: JsonRpcRequest,
) -> Result<JsonRpcResponse, RpcError> { ) -> Result<JsonRpcResponse, Error> {
use JsonRpcRequest as Req; use JsonRpcRequest as Req;
use JsonRpcResponse as Resp; use JsonRpcResponse as Resp;
@ -86,209 +86,209 @@ pub(super) async fn map_request(
async fn get_block_count( async fn get_block_count(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlockCountRequest, request: GetBlockCountRequest,
) -> Result<GetBlockCountResponse, RpcError> { ) -> Result<GetBlockCountResponse, Error> {
todo!() todo!()
} }
async fn on_get_block_hash( async fn on_get_block_hash(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: OnGetBlockHashRequest, request: OnGetBlockHashRequest,
) -> Result<OnGetBlockHashResponse, RpcError> { ) -> Result<OnGetBlockHashResponse, Error> {
todo!() todo!()
} }
async fn submit_block( async fn submit_block(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SubmitBlockRequest, request: SubmitBlockRequest,
) -> Result<SubmitBlockResponse, RpcError> { ) -> Result<SubmitBlockResponse, Error> {
todo!() todo!()
} }
async fn generate_blocks( async fn generate_blocks(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GenerateBlocksRequest, request: GenerateBlocksRequest,
) -> Result<GenerateBlocksResponse, RpcError> { ) -> Result<GenerateBlocksResponse, Error> {
todo!() todo!()
} }
async fn get_last_block_header( async fn get_last_block_header(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetLastBlockHeaderRequest, request: GetLastBlockHeaderRequest,
) -> Result<GetLastBlockHeaderResponse, RpcError> { ) -> Result<GetLastBlockHeaderResponse, Error> {
todo!() todo!()
} }
async fn get_block_header_by_hash( async fn get_block_header_by_hash(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlockHeaderByHashRequest, request: GetBlockHeaderByHashRequest,
) -> Result<GetBlockHeaderByHashResponse, RpcError> { ) -> Result<GetBlockHeaderByHashResponse, Error> {
todo!() todo!()
} }
async fn get_block_header_by_height( async fn get_block_header_by_height(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlockHeaderByHeightRequest, request: GetBlockHeaderByHeightRequest,
) -> Result<GetBlockHeaderByHeightResponse, RpcError> { ) -> Result<GetBlockHeaderByHeightResponse, Error> {
todo!() todo!()
} }
async fn get_block_headers_range( async fn get_block_headers_range(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlockHeadersRangeRequest, request: GetBlockHeadersRangeRequest,
) -> Result<GetBlockHeadersRangeResponse, RpcError> { ) -> Result<GetBlockHeadersRangeResponse, Error> {
todo!() todo!()
} }
async fn get_block( async fn get_block(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBlockRequest, request: GetBlockRequest,
) -> Result<GetBlockResponse, RpcError> { ) -> Result<GetBlockResponse, Error> {
todo!() todo!()
} }
async fn get_connections( async fn get_connections(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetConnectionsRequest, request: GetConnectionsRequest,
) -> Result<GetConnectionsResponse, RpcError> { ) -> Result<GetConnectionsResponse, Error> {
todo!() todo!()
} }
async fn get_info( async fn get_info(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetInfoRequest, request: GetInfoRequest,
) -> Result<GetInfoResponse, RpcError> { ) -> Result<GetInfoResponse, Error> {
todo!() todo!()
} }
async fn hard_fork_info( async fn hard_fork_info(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: HardForkInfoRequest, request: HardForkInfoRequest,
) -> Result<HardForkInfoResponse, RpcError> { ) -> Result<HardForkInfoResponse, Error> {
todo!() todo!()
} }
async fn set_bans( async fn set_bans(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetBansRequest, request: SetBansRequest,
) -> Result<SetBansResponse, RpcError> { ) -> Result<SetBansResponse, Error> {
todo!() todo!()
} }
async fn get_bans( async fn get_bans(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetBansRequest, request: GetBansRequest,
) -> Result<GetBansResponse, RpcError> { ) -> Result<GetBansResponse, Error> {
todo!() todo!()
} }
async fn banned( async fn banned(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: BannedRequest, request: BannedRequest,
) -> Result<BannedResponse, RpcError> { ) -> Result<BannedResponse, Error> {
todo!() todo!()
} }
async fn flush_transaction_pool( async fn flush_transaction_pool(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: FlushTransactionPoolRequest, request: FlushTransactionPoolRequest,
) -> Result<FlushTransactionPoolResponse, RpcError> { ) -> Result<FlushTransactionPoolResponse, Error> {
todo!() todo!()
} }
async fn get_output_histogram( async fn get_output_histogram(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetOutputHistogramRequest, request: GetOutputHistogramRequest,
) -> Result<GetOutputHistogramResponse, RpcError> { ) -> Result<GetOutputHistogramResponse, Error> {
todo!() todo!()
} }
async fn get_coinbase_tx_sum( async fn get_coinbase_tx_sum(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetCoinbaseTxSumRequest, request: GetCoinbaseTxSumRequest,
) -> Result<GetCoinbaseTxSumResponse, RpcError> { ) -> Result<GetCoinbaseTxSumResponse, Error> {
todo!() todo!()
} }
async fn get_version( async fn get_version(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetVersionRequest, request: GetVersionRequest,
) -> Result<GetVersionResponse, RpcError> { ) -> Result<GetVersionResponse, Error> {
todo!() todo!()
} }
async fn get_fee_estimate( async fn get_fee_estimate(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetFeeEstimateRequest, request: GetFeeEstimateRequest,
) -> Result<GetFeeEstimateResponse, RpcError> { ) -> Result<GetFeeEstimateResponse, Error> {
todo!() todo!()
} }
async fn get_alternate_chains( async fn get_alternate_chains(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetAlternateChainsRequest, request: GetAlternateChainsRequest,
) -> Result<GetAlternateChainsResponse, RpcError> { ) -> Result<GetAlternateChainsResponse, Error> {
todo!() todo!()
} }
async fn relay_tx( async fn relay_tx(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: RelayTxRequest, request: RelayTxRequest,
) -> Result<RelayTxResponse, RpcError> { ) -> Result<RelayTxResponse, Error> {
todo!() todo!()
} }
async fn sync_info( async fn sync_info(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SyncInfoRequest, request: SyncInfoRequest,
) -> Result<SyncInfoResponse, RpcError> { ) -> Result<SyncInfoResponse, Error> {
todo!() todo!()
} }
async fn get_transaction_pool_backlog( async fn get_transaction_pool_backlog(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionPoolBacklogRequest, request: GetTransactionPoolBacklogRequest,
) -> Result<GetTransactionPoolBacklogResponse, RpcError> { ) -> Result<GetTransactionPoolBacklogResponse, Error> {
todo!() todo!()
} }
async fn get_miner_data( async fn get_miner_data(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetMinerDataRequest, request: GetMinerDataRequest,
) -> Result<GetMinerDataResponse, RpcError> { ) -> Result<GetMinerDataResponse, Error> {
todo!() todo!()
} }
async fn prune_blockchain( async fn prune_blockchain(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: PruneBlockchainRequest, request: PruneBlockchainRequest,
) -> Result<PruneBlockchainResponse, RpcError> { ) -> Result<PruneBlockchainResponse, Error> {
todo!() todo!()
} }
async fn calc_pow( async fn calc_pow(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: CalcPowRequest, request: CalcPowRequest,
) -> Result<CalcPowResponse, RpcError> { ) -> Result<CalcPowResponse, Error> {
todo!() todo!()
} }
async fn flush_cache( async fn flush_cache(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: FlushCacheRequest, request: FlushCacheRequest,
) -> Result<FlushCacheResponse, RpcError> { ) -> Result<FlushCacheResponse, Error> {
todo!() todo!()
} }
async fn add_aux_pow( async fn add_aux_pow(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: AddAuxPowRequest, request: AddAuxPowRequest,
) -> Result<AddAuxPowResponse, RpcError> { ) -> Result<AddAuxPowResponse, Error> {
todo!() todo!()
} }
async fn get_tx_ids_loose( async fn get_tx_ids_loose(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTxIdsLooseRequest, request: GetTxIdsLooseRequest,
) -> Result<GetTxIdsLooseResponse, RpcError> { ) -> Result<GetTxIdsLooseResponse, Error> {
todo!() todo!()
} }

View file

@ -1,4 +1,5 @@
use cuprate_rpc_interface::RpcError; use anyhow::Error;
use cuprate_rpc_types::other::{ use cuprate_rpc_types::other::{
GetAltBlocksHashesRequest, GetAltBlocksHashesResponse, GetHeightRequest, GetHeightResponse, GetAltBlocksHashesRequest, GetAltBlocksHashesResponse, GetHeightRequest, GetHeightResponse,
GetLimitRequest, GetLimitResponse, GetNetStatsRequest, GetNetStatsResponse, GetOutsRequest, GetLimitRequest, GetLimitResponse, GetNetStatsRequest, GetNetStatsResponse, GetOutsRequest,
@ -22,7 +23,7 @@ use crate::rpc::CupratedRpcHandlerState;
pub(super) async fn map_request( pub(super) async fn map_request(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: OtherRequest, request: OtherRequest,
) -> Result<OtherResponse, RpcError> { ) -> Result<OtherResponse, Error> {
use OtherRequest as Req; use OtherRequest as Req;
use OtherResponse as Resp; use OtherResponse as Resp;
@ -72,188 +73,188 @@ pub(super) async fn map_request(
async fn get_height( async fn get_height(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetHeightRequest, request: GetHeightRequest,
) -> Result<GetHeightResponse, RpcError> { ) -> Result<GetHeightResponse, Error> {
todo!() todo!()
} }
async fn get_transactions( async fn get_transactions(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionsRequest, request: GetTransactionsRequest,
) -> Result<GetTransactionsResponse, RpcError> { ) -> Result<GetTransactionsResponse, Error> {
todo!() todo!()
} }
async fn get_alt_blocks_hashes( async fn get_alt_blocks_hashes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetAltBlocksHashesRequest, request: GetAltBlocksHashesRequest,
) -> Result<GetAltBlocksHashesResponse, RpcError> { ) -> Result<GetAltBlocksHashesResponse, Error> {
todo!() todo!()
} }
async fn is_key_image_spent( async fn is_key_image_spent(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: IsKeyImageSpentRequest, request: IsKeyImageSpentRequest,
) -> Result<IsKeyImageSpentResponse, RpcError> { ) -> Result<IsKeyImageSpentResponse, Error> {
todo!() todo!()
} }
async fn send_raw_transaction( async fn send_raw_transaction(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SendRawTransactionRequest, request: SendRawTransactionRequest,
) -> Result<SendRawTransactionResponse, RpcError> { ) -> Result<SendRawTransactionResponse, Error> {
todo!() todo!()
} }
async fn start_mining( async fn start_mining(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: StartMiningRequest, request: StartMiningRequest,
) -> Result<StartMiningResponse, RpcError> { ) -> Result<StartMiningResponse, Error> {
todo!() todo!()
} }
async fn stop_mining( async fn stop_mining(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: StopMiningRequest, request: StopMiningRequest,
) -> Result<StopMiningResponse, RpcError> { ) -> Result<StopMiningResponse, Error> {
todo!() todo!()
} }
async fn mining_status( async fn mining_status(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: MiningStatusRequest, request: MiningStatusRequest,
) -> Result<MiningStatusResponse, RpcError> { ) -> Result<MiningStatusResponse, Error> {
todo!() todo!()
} }
async fn save_bc( async fn save_bc(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SaveBcRequest, request: SaveBcRequest,
) -> Result<SaveBcResponse, RpcError> { ) -> Result<SaveBcResponse, Error> {
todo!() todo!()
} }
async fn get_peer_list( async fn get_peer_list(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetPeerListRequest, request: GetPeerListRequest,
) -> Result<GetPeerListResponse, RpcError> { ) -> Result<GetPeerListResponse, Error> {
todo!() todo!()
} }
async fn set_log_hash_rate( async fn set_log_hash_rate(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetLogHashRateRequest, request: SetLogHashRateRequest,
) -> Result<SetLogHashRateResponse, RpcError> { ) -> Result<SetLogHashRateResponse, Error> {
todo!() todo!()
} }
async fn set_log_level( async fn set_log_level(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetLogLevelRequest, request: SetLogLevelRequest,
) -> Result<SetLogLevelResponse, RpcError> { ) -> Result<SetLogLevelResponse, Error> {
todo!() todo!()
} }
async fn set_log_categories( async fn set_log_categories(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetLogCategoriesRequest, request: SetLogCategoriesRequest,
) -> Result<SetLogCategoriesResponse, RpcError> { ) -> Result<SetLogCategoriesResponse, Error> {
todo!() todo!()
} }
async fn set_bootstrap_daemon( async fn set_bootstrap_daemon(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetBootstrapDaemonRequest, request: SetBootstrapDaemonRequest,
) -> Result<SetBootstrapDaemonResponse, RpcError> { ) -> Result<SetBootstrapDaemonResponse, Error> {
todo!() todo!()
} }
async fn get_transaction_pool( async fn get_transaction_pool(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionPoolRequest, request: GetTransactionPoolRequest,
) -> Result<GetTransactionPoolResponse, RpcError> { ) -> Result<GetTransactionPoolResponse, Error> {
todo!() todo!()
} }
async fn get_transaction_pool_stats( async fn get_transaction_pool_stats(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionPoolStatsRequest, request: GetTransactionPoolStatsRequest,
) -> Result<GetTransactionPoolStatsResponse, RpcError> { ) -> Result<GetTransactionPoolStatsResponse, Error> {
todo!() todo!()
} }
async fn stop_daemon( async fn stop_daemon(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: StopDaemonRequest, request: StopDaemonRequest,
) -> Result<StopDaemonResponse, RpcError> { ) -> Result<StopDaemonResponse, Error> {
todo!() todo!()
} }
async fn get_limit( async fn get_limit(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetLimitRequest, request: GetLimitRequest,
) -> Result<GetLimitResponse, RpcError> { ) -> Result<GetLimitResponse, Error> {
todo!() todo!()
} }
async fn set_limit( async fn set_limit(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: SetLimitRequest, request: SetLimitRequest,
) -> Result<SetLimitResponse, RpcError> { ) -> Result<SetLimitResponse, Error> {
todo!() todo!()
} }
async fn out_peers( async fn out_peers(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: OutPeersRequest, request: OutPeersRequest,
) -> Result<OutPeersResponse, RpcError> { ) -> Result<OutPeersResponse, Error> {
todo!() todo!()
} }
async fn in_peers( async fn in_peers(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: InPeersRequest, request: InPeersRequest,
) -> Result<InPeersResponse, RpcError> { ) -> Result<InPeersResponse, Error> {
todo!() todo!()
} }
async fn get_net_stats( async fn get_net_stats(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetNetStatsRequest, request: GetNetStatsRequest,
) -> Result<GetNetStatsResponse, RpcError> { ) -> Result<GetNetStatsResponse, Error> {
todo!() todo!()
} }
async fn get_outs( async fn get_outs(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetOutsRequest, request: GetOutsRequest,
) -> Result<GetOutsResponse, RpcError> { ) -> Result<GetOutsResponse, Error> {
todo!() todo!()
} }
async fn update( async fn update(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: UpdateRequest, request: UpdateRequest,
) -> Result<UpdateResponse, RpcError> { ) -> Result<UpdateResponse, Error> {
todo!() todo!()
} }
async fn pop_blocks( async fn pop_blocks(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: PopBlocksRequest, request: PopBlocksRequest,
) -> Result<PopBlocksResponse, RpcError> { ) -> Result<PopBlocksResponse, Error> {
todo!() todo!()
} }
async fn get_transaction_pool_hashes( async fn get_transaction_pool_hashes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetTransactionPoolHashesRequest, request: GetTransactionPoolHashesRequest,
) -> Result<GetTransactionPoolHashesResponse, RpcError> { ) -> Result<GetTransactionPoolHashesResponse, Error> {
todo!() todo!()
} }
async fn get_public_nodes( async fn get_public_nodes(
state: CupratedRpcHandlerState, state: CupratedRpcHandlerState,
request: GetPublicNodesRequest, request: GetPublicNodesRequest,
) -> Result<GetPublicNodesResponse, RpcError> { ) -> Result<GetPublicNodesResponse, Error> {
todo!() todo!()
} }