@@ -5,7 +5,9 @@ use crate::config_models::network::Network;
5
5
use crate :: models:: blockchain:: block:: { block_height:: BlockHeight , Block } ;
6
6
use crate :: models:: peer:: peer_block_notifications:: PeerBlockNotification ;
7
7
use crate :: models:: peer:: tests:: automaton:: reference:: AssosiatedData ;
8
+ use crate :: models:: peer:: tests:: automaton:: BLOCKS_NEW_LEN ;
8
9
use crate :: models:: peer:: { BlockProposalRequest , SyncChallenge } ;
10
+ use crate :: models:: state:: wallet:: wallet_entropy:: WalletEntropy ;
9
11
use proptest:: prelude:: * ;
10
12
use proptest:: strategy:: { Just , Strategy } ;
11
13
use proptest_arbitrary_interop:: arb;
@@ -216,16 +218,35 @@ impl proptest_state_machine::strategy::ReferenceStateMachine for Automaton {
216
218
217
219
fn apply ( mut state : Self :: State , transition : & Self :: Transition ) -> Self :: State {
218
220
match transition {
219
- Transition ( variant, Some ( AssosiatedData :: MakeNewBlocks ( ts , seed_the) ) ) => {
221
+ Transition ( variant, Some ( AssosiatedData :: MakeNewBlocks ( _ts , seed_the) ) ) => {
220
222
let tip_at_request = state. blocks . last ( ) . unwrap ( ) . clone ( ) ;
221
- state. blocks . append ( & mut Runtime :: new ( ) . unwrap ( ) . block_on (
222
- crate :: tests:: shared:: fake_valid_sequence_of_blocks_for_tests_dyn (
223
- & tip_at_request,
224
- * ts,
225
- * seed_the,
226
- super :: super :: BLOCKS_NEW_LEN ,
227
- ) ,
228
- ) ) ;
223
+ // state.blocks.append(&mut Runtime::new().unwrap().block_on(
224
+ // crate::tests::shared::fake_valid_sequence_of_blocks_for_tests_dyn(
225
+ // &tip_at_request,
226
+ // *ts,
227
+ // *seed_the,
228
+ // super::super::BLOCKS_NEW_LEN,
229
+ // ),
230
+ // ));
231
+ let rt = Runtime :: new ( ) . unwrap ( ) ;
232
+ for i in 0 ..BLOCKS_NEW_LEN as u8 {
233
+ let mut seed = * seed_the;
234
+ seed[ 0 ] = seed[ 0 ] . wrapping_add ( i) ;
235
+ state. blocks . push (
236
+ rt. block_on ( crate :: tests:: shared:: make_mock_block (
237
+ // previous_block: &Block,
238
+ state. blocks . last ( ) . unwrap ( ) ,
239
+ // block_timestamp: Option<Timestamp>,
240
+ None ,
241
+ // composer_key: generation_address::GenerationSpendingKey,
242
+ WalletEntropy :: new_pseudorandom ( seed)
243
+ . nth_generation_spending_key_for_tests ( 0 ) ,
244
+ // seed: [u8; 32], // #seedReuse
245
+ seed,
246
+ ) )
247
+ . 0 ,
248
+ ) ;
249
+ }
229
250
if & PeerMessage :: BlockNotificationRequest == variant {
230
251
state. sync_stage = Some ( SyncStage :: WaitingForChallenge (
231
252
// a possible problem is a testing system will be responding with another block
0 commit comments