summaryrefslogtreecommitdiff
path: root/crates/tor-hsclient/src/pow/v1_stub.rs
blob: d308edcb4d75b82a6567bc79cd7176893e4b4b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! Stub; `v1` proof of work scheme has been disabled at compile time

use crate::err::ProofOfWorkError;
use tor_cell::relaycell::hs::pow::v1::ProofOfWorkV1;
use tor_hscrypto::pk::HsBlindId;
use tor_netdoc::doc::hsdesc::pow::v1::PowParamsV1;

/// Stub client for the `v1` scheme which never offers a solution
#[derive(Debug)]
pub(super) struct HsPowClientV1;

impl HsPowClientV1 {
    /// Stub constructor
    pub(super) fn new(_hs_blind_id: &HsBlindId, _params: &PowParamsV1) -> Self {
        Self
    }

    /// Stub; has no effect
    pub(super) fn increase_effort(&mut self) {}

    /// Stub; always returns None
    #[expect(clippy::unused_async)]
    pub(super) async fn solve(&self) -> Result<Option<ProofOfWorkV1>, ProofOfWorkError> {
        Ok(None)
    }
}