mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-11-16 15:58:14 +00:00
fixes
This commit is contained in:
parent
42d6f97847
commit
e7f052f1d0
8 changed files with 30 additions and 33 deletions
|
@ -116,7 +116,7 @@ pub struct CupratedRpcHandler {
|
|||
}
|
||||
|
||||
impl CupratedRpcHandler {
|
||||
/// TODO
|
||||
/// Create a new [`Self`].
|
||||
pub const fn new(
|
||||
restricted: bool,
|
||||
blockchain_read: BlockchainReadHandle,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Functions for TODO: doc enum message.
|
||||
//! Functions for [`BlockchainManagerRequest`] & [`BlockchainManagerResponse`].
|
||||
|
||||
use anyhow::Error;
|
||||
use monero_serai::block::Block;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Functions for TODO: doc enum message.
|
||||
//! Functions for [`TxpoolReadRequest`].
|
||||
|
||||
use std::convert::Infallible;
|
||||
|
||||
|
|
|
@ -254,9 +254,21 @@ pub enum BlockChainContextRequest {
|
|||
numb_blocks: usize,
|
||||
},
|
||||
|
||||
/// Get information on a certain hardfork.
|
||||
HardForkInfo(HardFork),
|
||||
|
||||
/// Get the current fee estimate.
|
||||
FeeEstimate {
|
||||
/// TODO
|
||||
grace_blocks: u64,
|
||||
},
|
||||
|
||||
/// Clear the alt chain context caches.
|
||||
ClearAltCache,
|
||||
|
||||
/// Get information on all the current alternate chains.
|
||||
AltChains,
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------- AltChainRequests
|
||||
/// A request for an alt chain context cache.
|
||||
///
|
||||
|
@ -318,18 +330,6 @@ pub enum BlockChainContextRequest {
|
|||
/// An internal token to prevent external crates calling this request.
|
||||
_token: AltChainRequestToken,
|
||||
},
|
||||
|
||||
/// Get information on a certain hardfork.
|
||||
HardForkInfo(HardFork),
|
||||
|
||||
/// Get the current fee estimate.
|
||||
FeeEstimate {
|
||||
/// TODO
|
||||
grace_blocks: u64,
|
||||
},
|
||||
|
||||
/// Get information on all the current alternate chains.
|
||||
AlternateChains,
|
||||
}
|
||||
|
||||
pub enum BlockChainContextResponse {
|
||||
|
@ -346,7 +346,6 @@ pub enum BlockChainContextResponse {
|
|||
/// Response to [`BlockChainContextRequest::Context`]
|
||||
Context(BlockChainContext),
|
||||
|
||||
// TODO: why does this return a `HashMap` when the request is `CurrentRxVm`?
|
||||
/// Response to [`BlockChainContextRequest::CurrentRxVm`]
|
||||
///
|
||||
/// A map of seed height to `RandomX` VMs.
|
||||
|
@ -355,6 +354,17 @@ pub enum BlockChainContextResponse {
|
|||
/// A list of difficulties.
|
||||
BatchDifficulties(Vec<u128>),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::HardForkInfo`]
|
||||
HardForkInfo(HardForkInfo),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::FeeEstimate`]
|
||||
FeeEstimate(FeeEstimate),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::AltChains`]
|
||||
///
|
||||
/// If the inner [`Vec::is_empty`], there were no alternate chains.
|
||||
AltChains(Vec<ChainInfo>),
|
||||
|
||||
/// An alt chain context cache.
|
||||
AltChainContextCache(Box<AltChainContextCache>),
|
||||
|
||||
|
@ -366,17 +376,6 @@ pub enum BlockChainContextResponse {
|
|||
|
||||
/// A weight cache for an alt chain
|
||||
AltChainWeightCache(BlockWeightsCache),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::HardForkInfo`]
|
||||
HardForkInfo(HardForkInfo),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::FeeEstimate`]
|
||||
FeeEstimate(FeeEstimate),
|
||||
|
||||
/// Response to [`BlockChainContextRequest::AlternateChains`]
|
||||
///
|
||||
/// If the inner [`Vec::is_empty`], there were no alternate chains.
|
||||
AlternateChains(Vec<ChainInfo>),
|
||||
}
|
||||
|
||||
/// The blockchain context service.
|
||||
|
|
|
@ -327,7 +327,7 @@ impl<D: Database + Clone + Send + 'static> ContextTask<D> {
|
|||
}
|
||||
BlockChainContextRequest::HardForkInfo(_)
|
||||
| BlockChainContextRequest::FeeEstimate { .. }
|
||||
| BlockChainContextRequest::AlternateChains => {
|
||||
| BlockChainContextRequest::AltChains => {
|
||||
todo!("finish https://github.com/Cuprate/cuprate/pull/297")
|
||||
}
|
||||
})
|
||||
|
|
|
@ -4,14 +4,14 @@ use std::time::{Duration, Instant};
|
|||
|
||||
use crate::NetZoneAddress;
|
||||
|
||||
/// TODO
|
||||
/// Data within [`crate::services::AddressBookRequest::SetBan`].
|
||||
pub struct SetBan<A: NetZoneAddress> {
|
||||
pub address: A,
|
||||
pub ban: bool,
|
||||
pub duration: Duration,
|
||||
}
|
||||
|
||||
/// TODO
|
||||
/// Data within [`crate::services::AddressBookResponse::GetBans`].
|
||||
pub struct BanState<A: NetZoneAddress> {
|
||||
pub address: A,
|
||||
pub banned: bool,
|
||||
|
|
|
@ -133,7 +133,7 @@ pub enum AddressBookRequest<Z: NetworkZone> {
|
|||
|
||||
/// A response from the address book service.
|
||||
pub enum AddressBookResponse<Z: NetworkZone> {
|
||||
/// TODO
|
||||
/// Generic OK response.
|
||||
///
|
||||
/// Response to:
|
||||
/// - [`AddressBookRequest::NewConnection`]
|
||||
|
|
|
@ -139,8 +139,6 @@ pub enum BlockchainReadRequest {
|
|||
},
|
||||
|
||||
/// Get the necessary data to create a custom block template.
|
||||
///
|
||||
/// These are used by p2pool.
|
||||
MinerData,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue