Skip to content

Commit 0d7695e

Browse files
committed
Remove duplicate tests (duplicate of the "mutate_xxx" tests in mod.rs)
1 parent 316c9c2 commit 0d7695e

File tree

1 file changed

+0
-109
lines changed

1 file changed

+0
-109
lines changed

common/src/chain/transaction/signature/tests/sign_and_mutate.rs

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ use crate::{
2626
input_commitments::SighashInputCommitment,
2727
sighashtype::{OutputsMode, SigHashType},
2828
},
29-
tests::{
30-
check_insert_input, check_insert_output, check_mutate_input, check_mutate_output,
31-
sign_mutate_then_verify,
32-
},
3329
DestinationSigError,
3430
},
3531
signed_transaction::SignedTransaction,
@@ -119,111 +115,6 @@ fn test_mutate_tx_flags(#[case] seed: Seed) {
119115
}
120116
}
121117

122-
#[rstest]
123-
#[trace]
124-
#[case(Seed::from_entropy())]
125-
fn modify_and_verify(#[case] seed: Seed) {
126-
let mut rng = test_utils::random::make_seedable_rng(seed);
127-
128-
let chain_config = create_mainnet();
129-
130-
let (private_key, public_key) = PrivateKey::new_from_rng(&mut rng, KeyKind::Secp256k1Schnorr);
131-
let destination = Destination::PublicKey(public_key);
132-
133-
{
134-
let sighash_type = SigHashType::all();
135-
let tx = sign_mutate_then_verify(
136-
&chain_config,
137-
&mut rng,
138-
&private_key,
139-
sighash_type,
140-
&destination,
141-
);
142-
check_insert_input(&chain_config, &mut rng, &tx, &destination, true);
143-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
144-
check_insert_output(&chain_config, &mut rng, &tx, &destination, true);
145-
check_mutate_output(&chain_config, &tx, &destination, true);
146-
}
147-
148-
{
149-
let sighash_type =
150-
SigHashType::try_from(SigHashType::ALL | SigHashType::ANYONECANPAY).unwrap();
151-
let tx = sign_mutate_then_verify(
152-
&chain_config,
153-
&mut rng,
154-
&private_key,
155-
sighash_type,
156-
&destination,
157-
);
158-
check_insert_input(&chain_config, &mut rng, &tx, &destination, false);
159-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
160-
check_insert_output(&chain_config, &mut rng, &tx, &destination, true);
161-
check_mutate_output(&chain_config, &tx, &destination, true);
162-
}
163-
164-
{
165-
let sighash_type = SigHashType::try_from(SigHashType::NONE).unwrap();
166-
let tx = sign_mutate_then_verify(
167-
&chain_config,
168-
&mut rng,
169-
&private_key,
170-
sighash_type,
171-
&destination,
172-
);
173-
check_insert_input(&chain_config, &mut rng, &tx, &destination, true);
174-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
175-
check_insert_output(&chain_config, &mut rng, &tx, &destination, false);
176-
check_mutate_output(&chain_config, &tx, &destination, false);
177-
}
178-
179-
{
180-
let sighash_type =
181-
SigHashType::try_from(SigHashType::NONE | SigHashType::ANYONECANPAY).unwrap();
182-
let tx = sign_mutate_then_verify(
183-
&chain_config,
184-
&mut rng,
185-
&private_key,
186-
sighash_type,
187-
&destination,
188-
);
189-
check_insert_input(&chain_config, &mut rng, &tx, &destination, false);
190-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
191-
check_insert_output(&chain_config, &mut rng, &tx, &destination, false);
192-
check_mutate_output(&chain_config, &tx, &destination, false);
193-
}
194-
195-
{
196-
let sighash_type = SigHashType::try_from(SigHashType::SINGLE).unwrap();
197-
let tx = sign_mutate_then_verify(
198-
&chain_config,
199-
&mut rng,
200-
&private_key,
201-
sighash_type,
202-
&destination,
203-
);
204-
check_insert_input(&chain_config, &mut rng, &tx, &destination, true);
205-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
206-
check_insert_output(&chain_config, &mut rng, &tx, &destination, false);
207-
check_mutate_output(&chain_config, &tx, &destination, true);
208-
}
209-
210-
{
211-
let sighash_type =
212-
SigHashType::try_from(SigHashType::SINGLE | SigHashType::ANYONECANPAY).unwrap();
213-
let tx = sign_mutate_then_verify(
214-
&chain_config,
215-
&mut rng,
216-
&private_key,
217-
sighash_type,
218-
&destination,
219-
);
220-
check_insert_input(&chain_config, &mut rng, &tx, &destination, false);
221-
check_mutate_input(&chain_config, &mut rng, &tx, &destination, true);
222-
check_insert_output(&chain_config, &mut rng, &tx, &destination, false);
223-
check_mutate_output(&chain_config, &tx, &destination, true);
224-
}
225-
}
226-
227118
// The `ALL` signature hash type is applied to all inputs and all outputs, so any change must result
228119
// in the signature verification error.
229120
#[rstest]

0 commit comments

Comments
 (0)