@@ -617,3 +617,49 @@ fn test_get_block_hash_ok() {
617
617
. expect ( "Should return regtest genesis block hash!" ) ;
618
618
assert_eq ! ( BITCOIN_REGTEST_FIRST_BLOCK_HASH , hash) ;
619
619
}
620
+
621
+ #[ ignore]
622
+ #[ test]
623
+ fn test_send_raw_transaction_rebroadcast_ok ( ) {
624
+ if env:: var ( "BITCOIND_TEST" ) != Ok ( "1" . into ( ) ) {
625
+ return ;
626
+ }
627
+
628
+ let mut config = utils:: create_stx_config ( ) ;
629
+ config. burnchain . wallet_name = "my_wallet" . to_string ( ) ;
630
+
631
+ let mut btcd_controller = BitcoinCoreController :: from_stx_config ( config. clone ( ) ) ;
632
+ btcd_controller
633
+ . add_arg ( "-fallbackfee=0.0002" )
634
+ . start_bitcoind_v2 ( )
635
+ . expect ( "bitcoind should be started!" ) ;
636
+
637
+ let client = BitcoinRpcClient :: from_stx_config ( & config) . expect ( "Client creation ok!" ) ;
638
+ client
639
+ . create_wallet ( "my_wallet" , Some ( false ) )
640
+ . expect ( "create wallet ok!" ) ;
641
+
642
+ let address = client
643
+ . get_new_address ( None , Some ( AddressType :: Legacy ) )
644
+ . expect ( "get new address ok!" ) ;
645
+
646
+ //Create 1 UTXO
647
+ _ = client
648
+ . generate_to_address ( 101 , & address)
649
+ . expect ( "generate to address ok!" ) ;
650
+
651
+ //Need `fallbackfee` arg
652
+ let txid = client
653
+ . send_to_address ( & address, 2.0 )
654
+ . expect ( "send to address ok!" ) ;
655
+
656
+ let raw_tx = client
657
+ . get_raw_transaction ( & txid)
658
+ . expect ( "get raw transaction ok!" ) ;
659
+
660
+ let txid = client
661
+ . send_raw_transaction ( & raw_tx, None , None )
662
+ . expect ( "send raw transaction (rebroadcast) ok!" ) ;
663
+
664
+ assert_eq ! ( txid. to_bitcoin_hex( ) , raw_tx. txid( ) . to_string( ) ) ;
665
+ }
0 commit comments