@@ -9303,129 +9303,6 @@ fn v3_signer_api_endpoint() {
9303
9303
run_loop_thread. join ( ) . unwrap ( ) ;
9304
9304
}
9305
9305
9306
- /// Test `/v3/blockbyhash` API endpoint
9307
- ///
9308
- /// This endpoint returns the block blob given a height
9309
- #[ test]
9310
- #[ ignore]
9311
- fn v3_blockbyhash_api_endpoint ( ) {
9312
- if env:: var ( "BITCOIND_TEST" ) != Ok ( "1" . into ( ) ) {
9313
- return ;
9314
- }
9315
-
9316
- let ( mut conf, _miner_account) = naka_neon_integration_conf ( None ) ;
9317
- let password = "12345" . to_string ( ) ;
9318
- conf. connection_options . auth_token = Some ( password. clone ( ) ) ;
9319
- conf. miner . wait_on_interim_blocks = Duration :: from_secs ( 1 ) ;
9320
- let stacker_sk = setup_stacker ( & mut conf) ;
9321
- let signer_sk = Secp256k1PrivateKey :: new ( ) ;
9322
- let signer_addr = tests:: to_addr ( & signer_sk) ;
9323
- let sender_sk = Secp256k1PrivateKey :: new ( ) ;
9324
- // setup sender + recipient for some test stx transfers
9325
- // these are necessary for the interim blocks to get mined at all
9326
- let sender_addr = tests:: to_addr ( & sender_sk) ;
9327
- let send_amt = 100 ;
9328
- let send_fee = 180 ;
9329
- conf. add_initial_balance (
9330
- PrincipalData :: from ( sender_addr) . to_string ( ) ,
9331
- send_amt + send_fee,
9332
- ) ;
9333
- conf. add_initial_balance ( PrincipalData :: from ( signer_addr) . to_string ( ) , 100000 ) ;
9334
-
9335
- // only subscribe to the block proposal events
9336
- test_observer:: spawn ( ) ;
9337
- test_observer:: register ( & mut conf, & [ EventKeyType :: BlockProposal ] ) ;
9338
-
9339
- let mut btcd_controller = BitcoinCoreController :: new ( conf. clone ( ) ) ;
9340
- btcd_controller
9341
- . start_bitcoind ( )
9342
- . expect ( "Failed starting bitcoind" ) ;
9343
- let mut btc_regtest_controller = BitcoinRegtestController :: new ( conf. clone ( ) , None ) ;
9344
- btc_regtest_controller. bootstrap_chain ( 201 ) ;
9345
-
9346
- let mut run_loop = boot_nakamoto:: BootRunLoop :: new ( conf. clone ( ) ) . unwrap ( ) ;
9347
- let run_loop_stopper = run_loop. get_termination_switch ( ) ;
9348
- let Counters {
9349
- blocks_processed,
9350
- naka_submitted_commits : commits_submitted,
9351
- naka_proposed_blocks : proposals_submitted,
9352
- ..
9353
- } = run_loop. counters ( ) ;
9354
-
9355
- let coord_channel = run_loop. coordinator_channels ( ) ;
9356
-
9357
- let run_loop_thread = thread:: spawn ( move || run_loop. start ( None , 0 ) ) ;
9358
- let mut signers = TestSigners :: new ( vec ! [ signer_sk] ) ;
9359
- wait_for_runloop ( & blocks_processed) ;
9360
- boot_to_epoch_3 (
9361
- & conf,
9362
- & blocks_processed,
9363
- & [ stacker_sk] ,
9364
- & [ signer_sk] ,
9365
- & mut Some ( & mut signers) ,
9366
- & mut btc_regtest_controller,
9367
- ) ;
9368
-
9369
- info ! ( "------------------------- Reached Epoch 3.0 -------------------------" ) ;
9370
-
9371
- blind_signer ( & conf, & signers, proposals_submitted) ;
9372
-
9373
- wait_for_first_naka_block_commit ( 60 , & commits_submitted) ;
9374
-
9375
- // Mine 1 nakamoto tenure
9376
- next_block_and_mine_commit (
9377
- & mut btc_regtest_controller,
9378
- 60 ,
9379
- & coord_channel,
9380
- & commits_submitted,
9381
- )
9382
- . unwrap ( ) ;
9383
-
9384
- let burnchain = conf. get_burnchain ( ) ;
9385
- let sortdb = burnchain. open_sortition_db ( true ) . unwrap ( ) ;
9386
- let ( chainstate, _) = StacksChainState :: open (
9387
- conf. is_mainnet ( ) ,
9388
- conf. burnchain . chain_id ,
9389
- & conf. get_chainstate_path_str ( ) ,
9390
- None ,
9391
- )
9392
- . unwrap ( ) ;
9393
-
9394
- info ! ( "------------------------- Setup finished, run test -------------------------" ) ;
9395
-
9396
- let http_origin = format ! ( "http://{}" , & conf. node. rpc_bind) ;
9397
-
9398
- let get_v3_block_by_hash = |block_hash : & str | {
9399
- let url = & format ! ( "{http_origin}/v3/blockbyhash/{block_hash}" ) ;
9400
- info ! ( "Send request: GET {url}" ) ;
9401
- reqwest:: blocking:: get ( url) . unwrap_or_else ( |e| panic ! ( "GET request failed: {e}" ) )
9402
- } ;
9403
-
9404
- let tip = NakamotoChainState :: get_canonical_block_header ( chainstate. db ( ) , & sortdb)
9405
- . unwrap ( )
9406
- . unwrap ( ) ;
9407
-
9408
- let block_hash = tip
9409
- . anchored_header
9410
- . as_stacks_nakamoto ( )
9411
- . unwrap ( )
9412
- . block_hash ( )
9413
- . to_string ( ) ;
9414
- let block_data = get_v3_block_by_hash ( & block_hash) ;
9415
- assert ! ( block_data. status( ) . is_success( ) ) ;
9416
- assert ! ( block_data. bytes( ) . unwrap( ) . len( ) > 0 ) ;
9417
-
9418
- info ! ( "------------------------- Test finished, clean up -------------------------" ) ;
9419
-
9420
- coord_channel
9421
- . lock ( )
9422
- . expect ( "Mutex poisoned" )
9423
- . stop_chains_coordinator ( ) ;
9424
- run_loop_stopper. store ( false , Ordering :: SeqCst ) ;
9425
-
9426
- run_loop_thread. join ( ) . unwrap ( ) ;
9427
- }
9428
-
9429
9306
/// Test `/v3/blocks/height` API endpoint
9430
9307
///
9431
9308
/// This endpoint returns the block blob given a height
0 commit comments