@@ -29,8 +29,8 @@ use bitcoin::hashes::Hash;
2929use bitcoin:: sign_message:: MessageSignature ;
3030use bitcoin:: { secp256k1, sighash, ScriptBuf } ;
3131use bitcoin:: {
32- transaction, Address , Amount , Network , OutPoint , PrivateKey , Sequence , SignedAmount ,
33- Transaction , TxIn , TxOut , Txid , Witness ,
32+ transaction, Address , Amount , CompressedPublicKey , Network , OutPoint , PrivateKey , Sequence ,
33+ SignedAmount , Transaction , TxIn , TxOut , Txid , Witness ,
3434} ;
3535use bitcoincore_rpc:: bitcoincore_rpc_json:: {
3636 GetBlockTemplateModes , GetBlockTemplateRules , GetZmqNotificationsResult , ScanTxOutRequest ,
@@ -272,7 +272,8 @@ fn test_get_raw_change_address(cl: &Client) {
272272fn test_dump_private_key ( cl : & Client ) {
273273 let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
274274 let sk = cl. dump_private_key ( & addr) . unwrap ( ) ;
275- assert_eq ! ( addr, Address :: p2wpkh( & sk. public_key( & SECP ) , * NET ) . unwrap( ) ) ;
275+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
276+ assert_eq ! ( addr, Address :: p2wpkh( & pk, * NET ) ) ;
276277}
277278
278279fn test_generate ( cl : & Client ) {
@@ -592,11 +593,12 @@ fn test_get_block_filter(cl: &Client) {
592593
593594fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
594595 let sk = PrivateKey {
595- network : Network :: Regtest ,
596+ network : Network :: Regtest . into ( ) ,
596597 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
597598 compressed : true ,
598599 } ;
599- let addr = Address :: p2wpkh ( & sk. public_key ( & SECP ) , Network :: Regtest ) . unwrap ( ) ;
600+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
601+ let addr = Address :: p2wpkh ( & pk, Network :: Regtest ) ;
600602
601603 let options = json:: ListUnspentQueryOptions {
602604 minimum_amount : Some ( btc ( 2 ) ) ,
@@ -720,7 +722,7 @@ fn test_decode_raw_transaction(cl: &Client) {
720722
721723 let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
722724
723- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
725+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
724726 assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
725727
726728 assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -1010,7 +1012,7 @@ fn test_list_received_by_address(cl: &Client) {
10101012
10111013fn test_import_public_key ( cl : & Client ) {
10121014 let sk = PrivateKey {
1013- network : Network :: Regtest ,
1015+ network : Network :: Regtest . into ( ) ,
10141016 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10151017 compressed : true ,
10161018 } ;
@@ -1021,7 +1023,7 @@ fn test_import_public_key(cl: &Client) {
10211023
10221024fn test_import_priv_key ( cl : & Client ) {
10231025 let sk = PrivateKey {
1024- network : Network :: Regtest ,
1026+ network : Network :: Regtest . into ( ) ,
10251027 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10261028 compressed : true ,
10271029 } ;
@@ -1032,7 +1034,7 @@ fn test_import_priv_key(cl: &Client) {
10321034
10331035fn test_import_address ( cl : & Client ) {
10341036 let sk = PrivateKey {
1035- network : Network :: Regtest ,
1037+ network : Network :: Regtest . into ( ) ,
10361038 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10371039 compressed : true ,
10381040 } ;
@@ -1044,7 +1046,7 @@ fn test_import_address(cl: &Client) {
10441046
10451047fn test_import_address_script ( cl : & Client ) {
10461048 let sk = PrivateKey {
1047- network : Network :: Regtest ,
1049+ network : Network :: Regtest . into ( ) ,
10481050 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10491051 compressed : true ,
10501052 } ;
0 commit comments