@@ -861,31 +861,60 @@ impl BlockchainFactory for RpcBlockchainFactory {
861861
862862#[ cfg( test) ]
863863#[ cfg( any( feature = "test-rpc" , feature = "test-rpc-legacy" ) ) ]
864- mod test {
864+ pub mod test {
865865 use super :: * ;
866- use crate :: {
867- descriptor:: { into_wallet_descriptor_checked, AsDerived } ,
868- testutils:: blockchain_tests:: TestClient ,
869- wallet:: utils:: SecpCtx ,
870- } ;
866+ use crate :: descriptor:: into_wallet_descriptor_checked;
867+ use crate :: descriptor:: AsDerived ;
868+ use crate :: make_blockchain_tests;
869+ use crate :: testutils:: blockchain_tests:: BlockchainType ;
870+ use crate :: testutils:: blockchain_tests:: TestClient ;
871+ use crate :: wallet:: utils:: SecpCtx ;
871872
872873 use bitcoin:: { Address , Network } ;
873874 use bitcoincore_rpc:: RpcApi ;
874875 use log:: LevelFilter ;
875876 use miniscript:: DescriptorTrait ;
876877
877- crate :: bdk_blockchain_tests! {
878- fn test_instance( test_client: & TestClient ) -> RpcBlockchain {
879- let config = RpcConfig {
880- url: test_client. bitcoind. rpc_url( ) ,
881- auth: Auth :: Cookie { file: test_client. bitcoind. params. cookie_file. clone( ) } ,
882- network: Network :: Regtest ,
883- wallet_name: format!( "client-wallet-test-{}" , std:: time:: SystemTime :: now( ) . duration_since( std:: time:: UNIX_EPOCH ) . unwrap( ) . as_nanos( ) ) ,
884- sync_params: None ,
885- } ;
886- RpcBlockchain :: from_config( & config) . unwrap( )
887- }
888- }
878+ make_blockchain_tests ! [
879+ blockchain BlockchainType :: RpcBlockchain ,
880+ tests (
881+ test_sync_simple,
882+ test_sync_stop_gap_20,
883+ test_sync_before_and_after_receive,
884+ test_sync_multiple_outputs_same_tx,
885+ test_sync_receive_multi,
886+ test_sync_address_reuse,
887+ test_sync_receive_rbf_replaced,
888+ test_sync_after_send,
889+ test_sync_address_index_should_not_decrement,
890+ test_sync_address_index_should_increment,
891+ test_sync_double_receive,
892+ test_sync_many_sends_to_a_single_address,
893+ test_update_confirmation_time_after_generate,
894+ test_sync_outgoing_from_scratch,
895+ test_sync_long_change_chain,
896+ test_sync_bump_fee_basic,
897+ test_sync_bump_fee_add_input_simple,
898+ test_sync_bump_fee_add_input_no_change,
899+ test_sync_receive_coinbase,
900+ test_double_spend,
901+ test_tx_chain,
902+ test_get_block_hash,
903+ )
904+ ] ;
905+
906+ #[ cfg( not( feature = "test-rpc-legacy" ) ) ]
907+ make_blockchain_tests ! [
908+ blockchain BlockchainType :: RpcBlockchain ,
909+ tests (
910+ test_send_to_bech32m_addr,
911+ test_taproot_key_spend,
912+ test_taproot_script_spend,
913+ test_sign_taproot_core_keyspend_psbt,
914+ test_sign_taproot_core_scriptspend2_psbt,
915+ test_sign_taproot_core_scriptspend3_psbt,
916+ )
917+ ] ;
889918
890919 fn get_factory ( ) -> ( TestClient , RpcBlockchainFactory ) {
891920 let test_client = TestClient :: default ( ) ;
0 commit comments