reorder types, add docs

This commit is contained in:
Alexey Shekhirin
2025-11-10 23:17:26 +00:00
parent a02168fc48
commit e679fbd62e
2 changed files with 15 additions and 8 deletions

View File

@@ -117,7 +117,7 @@ pub enum PruneSegmentError {
#[error("the configuration provided for {0} is invalid")]
Configuration(PruneSegment),
/// Unsupported receipts log filter prune mode for address.
#[error("distance prune mode is not supported for receipts log filter, check address {0}")]
#[error("receipts log filter for address {0} does not support distance prune mode")]
UnsupportedReceiptsLogFilterDistance(Address),
}

View File

@@ -18,15 +18,15 @@ pub enum EitherWriter<'a, CURSOR, N> {
StaticFile(StaticFileProviderRWRefMut<'a, N>),
}
#[derive(Debug, EnumIs)]
#[allow(missing_docs)]
pub enum EitherWriterDestination {
Database,
StaticFile,
}
impl EitherWriter<'_, (), ()> {
/// Returns the destination for writing receipts.
///
/// The rules are as follows:
/// - If the node should not always write receipts to static files, and any receipt pruning is
/// enabled, write to the database.
/// - If the node should always write receipts to static files, but receipt log filter pruning
/// is enabled, write to the database.
/// - Otherwise, write to static files.
pub fn receipts_destination<P: DBProvider + StorageSettingsCache>(
provider: &P,
) -> EitherWriterDestination {
@@ -44,6 +44,13 @@ impl EitherWriter<'_, (), ()> {
}
}
#[derive(Debug, EnumIs)]
#[allow(missing_docs)]
pub enum EitherWriterDestination {
Database,
StaticFile,
}
impl<'a, CURSOR, N: NodePrimitives> EitherWriter<'a, CURSOR, N> {
/// Increment the block number.
///