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

This commit is contained in:
hinto.janai 2024-09-19 18:26:36 -04:00
parent d2adf9034c
commit c079f9e7c0
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
9 changed files with 26 additions and 24 deletions

2
Cargo.lock generated
View file

@ -552,6 +552,7 @@ dependencies = [
name = "cuprate-consensus"
version = "0.1.0"
dependencies = [
"cfg-if",
"cuprate-consensus-rules",
"cuprate-helper",
"cuprate-test-utils",
@ -579,6 +580,7 @@ dependencies = [
name = "cuprate-consensus-rules"
version = "0.1.0"
dependencies = [
"cfg-if",
"crypto-bigint",
"cuprate-cryptonight",
"cuprate-helper",

View file

@ -210,7 +210,6 @@ unseparated_literal_suffix = "deny"
unnecessary_safety_doc = "deny"
unnecessary_safety_comment = "deny"
unnecessary_self_imports = "deny"
tests_outside_test_module = "deny"
string_to_string = "deny"
rest_pat_in_fully_bound_structs = "deny"
redundant_type_annotations = "deny"

View file

@ -12,6 +12,7 @@ cuprate-helper = { path = "../helper", default-features = false, features = ["st
cuprate-consensus-rules = { path = "./rules", features = ["rayon"] }
cuprate-types = { path = "../types" }
cfg-if = { workspace = true }
thiserror = { workspace = true }
tower = { workspace = true, features = ["util"] }
tracing = { workspace = true, features = ["std", "attributes"] }

View file

@ -24,15 +24,16 @@ hex = { workspace = true, features = ["std"] }
hex-literal = { workspace = true }
crypto-bigint = { workspace = true }
cfg-if = { workspace = true }
tracing = { workspace = true, features = ["std"] }
thiserror = { workspace = true }
rayon = { workspace = true, optional = true }
[dev-dependencies]
proptest = {workspace = true}
proptest-derive = {workspace = true}
tokio = {version = "1.35.0", features = ["rt-multi-thread", "macros"]}
proptest = { workspace = true }
proptest-derive = { workspace = true }
tokio = { version = "1.35.0", features = ["rt-multi-thread", "macros"] }
[lints]
workspace = true

View file

@ -1,9 +1,11 @@
#[cfg(test)]
use proptest as _;
#[cfg(test)]
use proptest_derive as _;
#[cfg(test)]
use tokio as _;
cfg_if::cfg_if! {
// Used in external `tests/`.
if #[cfg(test)] {
use proptest as _;
use proptest_derive as _;
use tokio as _;
}
}
use std::time::{SystemTime, UNIX_EPOCH};

View file

@ -103,7 +103,7 @@ impl DecoyInfo {
///
/// So:
///
/// `amount_outs_on_chain(inputs``[X]`) == `outputs_with_amount``[X]`
/// `amount_outs_on_chain(inputs[X]) == outputs_with_amount[X]`
///
/// Do not rely on this function to do consensus checks!
///

View file

@ -333,7 +333,7 @@ impl<D: Database + Clone + Send + 'static> ContextTask<D> {
pub(crate) async fn run(mut self, mut rx: mpsc::Receiver<ContextTaskRequest>) {
while let Some(req) = rx.recv().await {
let res = self.handle_req(req.req).instrument(req.span).await;
let _unused = req.tx.send(res);
drop(req.tx.send(res));
}
tracing::info!("Shutting down blockchain context task.");

View file

@ -11,13 +11,14 @@
//! with [`BlockchainResponse`].
//!
// Used in external `tests/`.
#[cfg(test)]
use cuprate_test_utils as _;
#[cfg(test)]
use curve25519_dalek as _;
#[cfg(test)]
use hex_literal as _;
cfg_if::cfg_if! {
// Used in external `tests/`.
if #[cfg(test)] {
use cuprate_test_utils as _;
use curve25519_dalek as _;
use hex_literal as _;
}
}
use cuprate_consensus_rules::ConsensusError;

View file

@ -1,8 +1,4 @@
#![expect(
clippy::tests_outside_test_module,
unused_crate_dependencies,
reason = "external test module"
)]
#![expect(unused_crate_dependencies, reason = "external test module")]
#![expect(clippy::allow_attributes, reason = "usage inside macro")]
use std::{