This commit is contained in:
hinto.janai 2024-11-26 19:37:35 -05:00
parent 1ffa86c5ae
commit 916d593024
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
6 changed files with 4 additions and 8 deletions

View file

@ -31,7 +31,7 @@ cuprate-txpool = { workspace = true }
cuprate-database = { workspace = true }
cuprate-pruning = { workspace = true }
cuprate-test-utils = { workspace = true }
cuprate-types = { workspace = true }
cuprate-types = { workspace = true, features = ["json"] }
cuprate-json-rpc = { workspace = true }
cuprate-rpc-interface = { workspace = true }
cuprate-rpc-types = { workspace = true }

View file

@ -140,7 +140,7 @@ pub type BlockchainManagerHandle = cuprate_database_service::DatabaseReadService
/// TODO
#[derive(Clone)]
pub struct CupratedRpcHandler {
/// Should this RPC server be [restricted](RpcHandler::restricted)?
/// Should this RPC server be [restricted](RpcHandler::is_restricted)?
///
/// This is not `pub` on purpose, as it should not be mutated after [`Self::new`].
restricted: bool,

View file

@ -164,7 +164,7 @@ pub(super) fn hex_to_hash(hex: String) -> Result<[u8; 32], Error> {
Ok(hash)
}
/// [`BlockchainResponse::ChainHeight`] minus 1.
/// [`cuprate_types::blockchain::BlockchainResponse::ChainHeight`] minus 1.
pub(super) async fn top_height(state: &mut CupratedRpcHandler) -> Result<(u64, [u8; 32]), Error> {
let (chain_height, hash) = blockchain::chain_height(&mut state.blockchain_read).await?;
let height = chain_height.saturating_sub(1);

View file

@ -117,9 +117,6 @@ pub(super) async fn map_request(
Req::GetTransactionPoolBacklog(r) => {
Resp::GetTransactionPoolBacklog(get_transaction_pool_backlog(state, r).await?)
}
Req::GetOutputDistribution(r) => {
Resp::GetOutputDistribution(get_output_distribution(state, r).await?)
}
Req::GetMinerData(r) => Resp::GetMinerData(get_miner_data(state, r).await?),
Req::PruneBlockchain(r) => Resp::PruneBlockchain(prune_blockchain(state, r).await?),
Req::CalcPow(r) => Resp::CalcPow(calc_pow(state, r).await?),

View file

@ -59,7 +59,7 @@ The error type must always be [`anyhow::Error`].
The `RpcHandler` must also hold some state that is required
for RPC server operation.
The only state currently needed is [`RpcHandler::restricted`], which determines if an RPC
The only state currently needed is [`RpcHandler::is_restricted`], which determines if an RPC
server is restricted or not, and thus, if some endpoints/methods are allowed or not.
# Unknown endpoint behavior

View file

@ -1755,7 +1755,6 @@ pub enum JsonRpcResponse {
RelayTx(RelayTxResponse),
SyncInfo(SyncInfoResponse),
GetTransactionPoolBacklog(GetTransactionPoolBacklogResponse),
GetOutputDistribution(GetOutputDistributionResponse),
GetMinerData(GetMinerDataResponse),
PruneBlockchain(PruneBlockchainResponse),
CalcPow(CalcPowResponse),