/// Initializes testkit, passes it into a handler, and creates the specified number
/// of empty blocks in the testkit blockchain.
Initializes testkit, passes it into a handler, and creates the specified number
of empty blocks in the testkit blockchain.
Initializes testkit passes it into a handler and creates the specified number of empty blocks in the testkit blockchain .
fn init_handler(height: Height) -> TestKitApi {
        let service = SampleService;
        let artifact = service.artifact_id();
        let mut testkit = TestKitBuilder::validator()
            .with_artifact(artifact.clone())
            .with_instance(
                artifact.into_default_instance(TIMESTAMP_SERVICE_ID, TIMESTAMP_SERVICE_NAME),
            )
            .with_rust_service(service)
            .build();
        testkit.create_blocks_until(height);
        // Process incoming events in background.
        let events = testkit.remove_events_stream();
        thread::spawn(|| events.wait().ok());
        let api_sender = testkit.api_sender.clone();
        let (aggregator, _) = TestKitActor::spawn(testkit);
        TestKitApi::from_raw_parts(aggregator, api_sender)
    }
fn init_handler ( height : Height ) -> TestKitApi { let service = SampleService ; let artifact = service . artifact_id ( ) ; let mut testkit = TestKitBuilder :: validator ( ) . with_artifact ( artifact . clone ( ) ) . with_instance ( artifact . into_default_instance ( TIMESTAMP_SERVICE_ID , TIMESTAMP_SERVICE_NAME ) , ) . with_rust_service ( service ) . build ( ) ; testkit . create_blocks_until ( height ) ; // Process incoming events in background. let events = testkit . remove_events_stream ( ) ; thread :: spawn ( | | events . wait ( ) . ok ( ) ) ; let api_sender = testkit . api_sender . clone ( ) ; let ( aggregator , _ ) = TestKitActor :: spawn ( testkit ) ; TestKitApi :: from_raw_parts ( aggregator , api_sender ) }
Initializes testkit, passes it into a handler, and creates the specified number
of empty blocks in the testkit blockchain.
Initializes testkit passes it into a handler and creates the specified number of empty blocks in the testkit blockchain .
height
Height