fixes
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled

This commit is contained in:
hinto.janai 2024-10-02 20:20:01 -04:00
parent 42d6f97847
commit e7f052f1d0
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
8 changed files with 30 additions and 33 deletions

View file

@ -116,7 +116,7 @@ pub struct CupratedRpcHandler {
}
impl CupratedRpcHandler {
/// TODO
/// Create a new [`Self`].
pub const fn new(
restricted: bool,
blockchain_read: BlockchainReadHandle,

View file

@ -1,4 +1,4 @@
//! Functions for TODO: doc enum message.
//! Functions for [`BlockchainManagerRequest`] & [`BlockchainManagerResponse`].
use anyhow::Error;
use monero_serai::block::Block;

View file

@ -1,4 +1,4 @@
//! Functions for TODO: doc enum message.
//! Functions for [`TxpoolReadRequest`].
use std::convert::Infallible;

View file

@ -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.

View file

@ -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")
}
})

View file

@ -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,

View file

@ -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`]

View file

@ -139,8 +139,6 @@ pub enum BlockchainReadRequest {
},
/// Get the necessary data to create a custom block template.
///
/// These are used by p2pool.
MinerData,
}