@@ -1192,7 +1192,7 @@ mod test {
11921192 let rejection = BlockRejection :: new (
11931193 Sha512Trunc256Sum ( [ 0u8 ; 32 ] ) ,
11941194 RejectCode :: ValidationFailed ( ValidateRejectCode :: InvalidBlock ) ,
1195- & StacksPrivateKey :: new ( ) ,
1195+ & StacksPrivateKey :: random ( ) ,
11961196 thread_rng ( ) . gen_bool ( 0.5 ) ,
11971197 thread_rng ( ) . next_u64 ( ) ,
11981198 ) ;
@@ -1204,7 +1204,7 @@ mod test {
12041204 let rejection = BlockRejection :: new (
12051205 Sha512Trunc256Sum ( [ 1u8 ; 32 ] ) ,
12061206 RejectCode :: ConnectivityIssues ,
1207- & StacksPrivateKey :: new ( ) ,
1207+ & StacksPrivateKey :: random ( ) ,
12081208 thread_rng ( ) . gen_bool ( 0.5 ) ,
12091209 thread_rng ( ) . next_u64 ( ) ,
12101210 ) ;
@@ -1231,7 +1231,7 @@ mod test {
12311231 let response = BlockResponse :: Rejected ( BlockRejection :: new (
12321232 Sha512Trunc256Sum ( [ 1u8 ; 32 ] ) ,
12331233 RejectCode :: ValidationFailed ( ValidateRejectCode :: InvalidBlock ) ,
1234- & StacksPrivateKey :: new ( ) ,
1234+ & StacksPrivateKey :: random ( ) ,
12351235 thread_rng ( ) . gen_bool ( 0.5 ) ,
12361236 thread_rng ( ) . next_u64 ( ) ,
12371237 ) ) ;
@@ -1318,10 +1318,10 @@ mod test {
13181318
13191319 #[ test]
13201320 fn verify_sign_mock_proposal ( ) {
1321- let private_key = StacksPrivateKey :: new ( ) ;
1321+ let private_key = StacksPrivateKey :: random ( ) ;
13221322 let public_key = StacksPublicKey :: from_private ( & private_key) ;
13231323
1324- let bad_private_key = StacksPrivateKey :: new ( ) ;
1324+ let bad_private_key = StacksPrivateKey :: random ( ) ;
13251325 let bad_public_key = StacksPublicKey :: from_private ( & bad_private_key) ;
13261326
13271327 let mut mock_proposal = random_mock_proposal ( ) ;
@@ -1353,7 +1353,7 @@ mod test {
13531353 #[ test]
13541354 fn serde_mock_proposal ( ) {
13551355 let mut mock_signature = random_mock_proposal ( ) ;
1356- mock_signature. sign ( & StacksPrivateKey :: new ( ) ) . unwrap ( ) ;
1356+ mock_signature. sign ( & StacksPrivateKey :: random ( ) ) . unwrap ( ) ;
13571357 let serialized_signature = mock_signature. serialize_to_vec ( ) ;
13581358 let deserialized_signature = read_next :: < MockProposal , _ > ( & mut & serialized_signature[ ..] )
13591359 . expect ( "Failed to deserialize MockSignature" ) ;
@@ -1368,7 +1368,7 @@ mod test {
13681368 metadata : SignerMessageMetadata :: default ( ) ,
13691369 } ;
13701370 mock_signature
1371- . sign ( & StacksPrivateKey :: new ( ) )
1371+ . sign ( & StacksPrivateKey :: random ( ) )
13721372 . expect ( "Failed to sign MockSignature" ) ;
13731373 let serialized_signature = mock_signature. serialize_to_vec ( ) ;
13741374 let deserialized_signature = read_next :: < MockSignature , _ > ( & mut & serialized_signature[ ..] )
@@ -1379,8 +1379,10 @@ mod test {
13791379 #[ test]
13801380 fn serde_mock_block ( ) {
13811381 let mock_proposal = random_mock_proposal ( ) ;
1382- let mock_signature_1 = MockSignature :: new ( mock_proposal. clone ( ) , & StacksPrivateKey :: new ( ) ) ;
1383- let mock_signature_2 = MockSignature :: new ( mock_proposal. clone ( ) , & StacksPrivateKey :: new ( ) ) ;
1382+ let mock_signature_1 =
1383+ MockSignature :: new ( mock_proposal. clone ( ) , & StacksPrivateKey :: random ( ) ) ;
1384+ let mock_signature_2 =
1385+ MockSignature :: new ( mock_proposal. clone ( ) , & StacksPrivateKey :: random ( ) ) ;
13841386 let mock_block = MockBlock {
13851387 mock_proposal,
13861388 mock_signatures : vec ! [ mock_signature_1, mock_signature_2] ,
0 commit comments