tor_hsclient/pow/
v1_stub.rs

1//! Stub; `v1` proof of work scheme has been disabled at compile time
2
3use crate::err::ProofOfWorkError;
4use tor_cell::relaycell::hs::pow::v1::ProofOfWorkV1;
5use tor_hscrypto::pk::HsBlindId;
6use tor_netdoc::doc::hsdesc::pow::v1::PowParamsV1;
7
8/// Stub client for the `v1` scheme which never offers a solution
9#[derive(Debug)]
10pub(super) struct HsPowClientV1;
11
12impl HsPowClientV1 {
13    /// Stub constructor
14    pub(super) fn new(_hs_blind_id: &HsBlindId, _params: &PowParamsV1) -> Self {
15        Self
16    }
17
18    /// Stub; has no effect
19    pub(super) fn increase_effort(&mut self) {}
20
21    /// Stub; always returns None
22    pub(super) async fn solve(&self) -> Result<Option<ProofOfWorkV1>, ProofOfWorkError> {
23        Ok(None)
24    }
25}