Skip to content

Commit

Permalink
Remove test_tweak_keys
Browse files Browse the repository at this point in the history
What it tests no longer applies since tweak_keys now introduces an unspendable
script path.
  • Loading branch information
kayabaNerve committed Sep 20, 2024
1 parent 3af430d commit 669b2fe
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions networks/bitcoin/tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,6 @@ fn sign(
sign_without_caching(&mut OsRng, machines, &[])
}

#[test]
fn test_tweak_keys() {
let mut even = false;
let mut odd = false;

// Generate keys until we get an even set and an odd set
while !(even && odd) {
let mut keys = key_gen(&mut OsRng).drain().next().unwrap().1;
if is_even(keys.group_key()) {
// Tweaking should do nothing
assert_eq!(tweak_keys(&keys).group_key(), keys.group_key());

even = true;
} else {
let tweaked = tweak_keys(&keys).group_key();
assert_ne!(tweaked, keys.group_key());
// Tweaking should produce an even key
assert!(is_even(tweaked));

// Verify it uses the smallest possible offset
while keys.group_key().to_encoded_point(true).tag() == Tag::CompressedOddY {
keys = keys.offset(Scalar::ONE);
}
assert_eq!(tweaked, keys.group_key());

odd = true;
}
}
}

async_sequential! {
async fn test_scanner() {
// Test Scanners are creatable for even keys.
Expand Down

0 comments on commit 669b2fe

Please sign in to comment.