fixed lint and unit test

This commit is contained in:
jonesmarvin8 2026-02-26 19:07:04 -05:00 committed by Marvin Jones
parent fe425aac11
commit 2ba7095029
2 changed files with 4 additions and 6 deletions

View File

@ -347,8 +347,8 @@ mod tests {
assert!(tree.key_map.contains_key(&ChainIndex::root()));
assert!(tree.account_id_map.contains_key(&AccountId::new([
172, 82, 222, 249, 164, 16, 148, 184, 219, 56, 92, 145, 203, 220, 251, 89, 214, 178,
38, 30, 108, 202, 251, 241, 148, 200, 125, 185, 93, 227, 189, 247
10, 231, 159, 65, 236, 46, 205, 5, 172, 89, 250, 29, 123, 195, 212, 137, 155, 111, 40,
120, 53, 28, 124, 54, 224, 170, 119, 208, 2, 72, 75, 50
])));
}

View File

@ -73,15 +73,13 @@ impl PrivateKey {
bytes.extend_from_slice(pk.to_encoded_point(true).as_bytes());
let hashed: [u8; 32] = Sha256::digest(&bytes).into();
let tweaked_sk = Self::try_new(
Self::try_new(
k256::Scalar::from_repr((*value).into())
.unwrap()
.add(&k256::Scalar::from_repr(hashed.into()).unwrap())
.to_bytes()
.into(),
);
tweaked_sk
)
}
}