@@ -28,7 +28,7 @@ use bitcoin::hashes::hex::FromHex;
2828use bitcoin:: hashes:: Hash ;
2929use bitcoin:: { secp256k1, ScriptBuf , sighash} ;
3030use bitcoin:: {
31- transaction, Address , Amount , Network , OutPoint , PrivateKey , Sequence , SignedAmount ,
31+ transaction, Address , Amount , CompressedPublicKey , Network , OutPoint , PrivateKey , Sequence , SignedAmount ,
3232 Transaction , TxIn , TxOut , Txid , Witness ,
3333} ;
3434use bitcoincore_rpc:: bitcoincore_rpc_json:: {
@@ -267,7 +267,8 @@ fn test_get_raw_change_address(cl: &Client) {
267267fn test_dump_private_key ( cl : & Client ) {
268268 let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
269269 let sk = cl. dump_private_key ( & addr) . unwrap ( ) ;
270- assert_eq ! ( addr, Address :: p2wpkh( & sk. public_key( & SECP ) , * NET ) . unwrap( ) ) ;
270+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
271+ assert_eq ! ( addr, Address :: p2wpkh( & pk, * NET ) ) ;
271272}
272273
273274fn test_generate ( cl : & Client ) {
@@ -570,11 +571,12 @@ fn test_get_block_filter(cl: &Client) {
570571
571572fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
572573 let sk = PrivateKey {
573- network : Network :: Regtest ,
574+ network : Network :: Regtest . into ( ) ,
574575 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
575576 compressed : true ,
576577 } ;
577- let addr = Address :: p2wpkh ( & sk. public_key ( & SECP ) , Network :: Regtest ) . unwrap ( ) ;
578+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
579+ let addr = Address :: p2wpkh ( & pk, Network :: Regtest ) ;
578580
579581 let options = json:: ListUnspentQueryOptions {
580582 minimum_amount : Some ( btc ( 2 ) ) ,
@@ -693,7 +695,7 @@ fn test_decode_raw_transaction(cl: &Client) {
693695
694696 let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
695697
696- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
698+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
697699 assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
698700
699701 assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -983,7 +985,7 @@ fn test_list_received_by_address(cl: &Client) {
983985
984986fn test_import_public_key ( cl : & Client ) {
985987 let sk = PrivateKey {
986- network : Network :: Regtest ,
988+ network : Network :: Regtest . into ( ) ,
987989 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
988990 compressed : true ,
989991 } ;
@@ -994,7 +996,7 @@ fn test_import_public_key(cl: &Client) {
994996
995997fn test_import_priv_key ( cl : & Client ) {
996998 let sk = PrivateKey {
997- network : Network :: Regtest ,
999+ network : Network :: Regtest . into ( ) ,
9981000 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
9991001 compressed : true ,
10001002 } ;
@@ -1005,7 +1007,7 @@ fn test_import_priv_key(cl: &Client) {
10051007
10061008fn test_import_address ( cl : & Client ) {
10071009 let sk = PrivateKey {
1008- network : Network :: Regtest ,
1010+ network : Network :: Regtest . into ( ) ,
10091011 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10101012 compressed : true ,
10111013 } ;
@@ -1017,7 +1019,7 @@ fn test_import_address(cl: &Client) {
10171019
10181020fn test_import_address_script ( cl : & Client ) {
10191021 let sk = PrivateKey {
1020- network : Network :: Regtest ,
1022+ network : Network :: Regtest . into ( ) ,
10211023 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10221024 compressed : true ,
10231025 } ;
0 commit comments