fix: satisfy clippy

This commit is contained in:
Daniil Polyakov 2026-03-19 18:03:23 +03:00
parent 83ef789002
commit c40c62a484
6 changed files with 17 additions and 16 deletions

1
Cargo.lock generated
View File

@ -8971,6 +8971,7 @@ dependencies = [
"nssa",
"nssa_core",
"optfield",
"rand 0.8.5",
"serde",
"serde_json",
"sha2",

View File

@ -28,4 +28,3 @@ async-stream.workspace = true
[dev-dependencies]
tempfile.workspace = true

View File

@ -137,13 +137,13 @@ impl<'a> From<&'a mut ChildKeysPrivate> for &'a mut (KeyChain, nssa::Account) {
#[cfg(test)]
mod tests {
use nssa_core::{NullifierPublicKey, NullifierSecretKey};
use nssa_core::NullifierSecretKey;
use super::*;
use crate::key_management::{self, secret_holders::ViewingSecretKey};
#[test]
fn test_master_key_generation() {
fn master_key_generation() {
let seed: [u8; 64] = [
252, 56, 204, 83, 232, 123, 209, 188, 187, 167, 39, 213, 71, 39, 58, 65, 125, 134, 255,
49, 43, 108, 92, 53, 173, 164, 94, 142, 150, 74, 21, 163, 43, 144, 226, 87, 199, 18,
@ -153,7 +153,7 @@ mod tests {
let keys = ChildKeysPrivate::root(seed);
let expected_ssk: SecretSpendingKey = key_management::secret_holders::SecretSpendingKey([
let expected_ssk = key_management::secret_holders::SecretSpendingKey([
246, 79, 26, 124, 135, 95, 52, 51, 201, 27, 48, 194, 2, 144, 51, 219, 245, 128, 139,
222, 42, 195, 105, 33, 115, 97, 186, 0, 97, 14, 218, 191,
]);
@ -168,11 +168,11 @@ mod tests {
34, 234, 19, 222, 2, 22, 12, 163, 252, 88, 11, 0, 163,
];
let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([
let expected_npk = nssa_core::NullifierPublicKey([
7, 123, 125, 191, 233, 183, 201, 4, 20, 214, 155, 210, 45, 234, 27, 240, 194, 111, 97,
247, 155, 113, 122, 246, 192, 0, 70, 61, 76, 71, 70, 2,
]);
let expected_vsk: ViewingSecretKey = [
let expected_vsk = [
155, 90, 54, 75, 228, 130, 68, 201, 129, 251, 180, 195, 250, 64, 34, 230, 241, 204,
216, 50, 149, 156, 10, 67, 208, 74, 9, 10, 47, 59, 50, 202,
];
@ -191,7 +191,7 @@ mod tests {
}
#[test]
fn test_child_keys_generation() {
fn child_keys_generation() {
let seed: [u8; 64] = [
252, 56, 204, 83, 232, 123, 209, 188, 187, 167, 39, 213, 71, 39, 58, 65, 125, 134, 255,
49, 43, 108, 92, 53, 173, 164, 94, 142, 150, 74, 21, 163, 43, 144, 226, 87, 199, 18,
@ -211,7 +211,7 @@ mod tests {
124, 61, 40, 92, 33, 135, 3, 41, 200, 234, 3, 69, 102, 184, 57, 191, 106, 151, 194,
192, 103, 132, 141, 112, 249, 108, 192, 117, 24, 48, 70, 216,
];
let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([
let expected_npk = nssa_core::NullifierPublicKey([
116, 231, 246, 189, 145, 240, 37, 59, 219, 223, 216, 246, 116, 171, 223, 55, 197, 200,
134, 192, 221, 40, 218, 167, 239, 5, 11, 95, 147, 247, 162, 226,
]);

View File

@ -64,7 +64,6 @@ impl KeyNode for ChildKeysPublic {
.unwrap();
let csk = nssa::PrivateKey::try_new({
#[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")]
let scalar = Scalar::from_be_bytes(*self.csk.value()).unwrap();
csk.add_tweak(&scalar)
@ -122,7 +121,7 @@ mod tests {
use super::*;
#[test]
fn test_master_keys_generation() {
fn master_keys_generation() {
let seed = [
88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173,
134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87,
@ -154,7 +153,7 @@ mod tests {
}
#[test]
fn test_harden_child_keys_generation() {
fn harden_child_keys_generation() {
let seed = [
88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173,
134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87,
@ -188,7 +187,7 @@ mod tests {
}
#[test]
fn test_nonharden_child_keys_generation() {
fn nonharden_child_keys_generation() {
let seed = [
88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173,
134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87,
@ -222,7 +221,7 @@ mod tests {
}
#[test]
fn test_edge_case_child_keys_generation_2_power_31() {
fn edge_case_child_keys_generation_2_power_31() {
let seed = [
88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173,
134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87,

View File

@ -37,4 +37,4 @@ test-case = "3.3.1"
[features]
default = []
prove = ["risc0-zkvm/prove"]
test-utils = []
test-utils = []

View File

@ -8,10 +8,12 @@ license = { workspace = true }
workspace = true
[dependencies]
nssa = { workspace = true, optional = true, features = ["test-utils"], default-features = true }
nssa = { workspace = true, optional = true, features = [
"test-utils",
], default-features = true }
nssa_core.workspace = true
token_core.workspace = true
amm_core.workspace = true
[features]
nssa = ["dep:nssa"]
nssa = ["dep:nssa"]