@@ -28,8 +28,8 @@ 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 ,
32- Transaction , TxIn , TxOut , Txid , Witness ,
31+ transaction, Address , Amount , CompressedPublicKey , Network , OutPoint , PrivateKey , Sequence ,
32+ SignedAmount , Transaction , TxIn , TxOut , Txid , Witness ,
3333} ;
3434use bitcoincore_rpc:: bitcoincore_rpc_json:: {
3535 GetBlockTemplateModes , GetBlockTemplateRules , GetZmqNotificationsResult , ScanTxOutRequest ,
@@ -268,7 +268,8 @@ fn test_get_raw_change_address(cl: &Client) {
268268fn test_dump_private_key ( cl : & Client ) {
269269 let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
270270 let sk = cl. dump_private_key ( & addr) . unwrap ( ) ;
271- assert_eq ! ( addr, Address :: p2wpkh( & sk. public_key( & SECP ) , * NET ) . unwrap( ) ) ;
271+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
272+ assert_eq ! ( addr, Address :: p2wpkh( & pk, * NET ) ) ;
272273}
273274
274275fn test_generate ( cl : & Client ) {
@@ -571,11 +572,12 @@ fn test_get_block_filter(cl: &Client) {
571572
572573fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
573574 let sk = PrivateKey {
574- network : Network :: Regtest ,
575+ network : Network :: Regtest . into ( ) ,
575576 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
576577 compressed : true ,
577578 } ;
578- let addr = Address :: p2wpkh ( & sk. public_key ( & SECP ) , Network :: Regtest ) . unwrap ( ) ;
579+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
580+ let addr = Address :: p2wpkh ( & pk, Network :: Regtest ) ;
579581
580582 let options = json:: ListUnspentQueryOptions {
581583 minimum_amount : Some ( btc ( 2 ) ) ,
@@ -694,7 +696,7 @@ fn test_decode_raw_transaction(cl: &Client) {
694696
695697 let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
696698
697- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
699+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
698700 assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
699701
700702 assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -984,7 +986,7 @@ fn test_list_received_by_address(cl: &Client) {
984986
985987fn test_import_public_key ( cl : & Client ) {
986988 let sk = PrivateKey {
987- network : Network :: Regtest ,
989+ network : Network :: Regtest . into ( ) ,
988990 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
989991 compressed : true ,
990992 } ;
@@ -995,7 +997,7 @@ fn test_import_public_key(cl: &Client) {
995997
996998fn test_import_priv_key ( cl : & Client ) {
997999 let sk = PrivateKey {
998- network : Network :: Regtest ,
1000+ network : Network :: Regtest . into ( ) ,
9991001 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10001002 compressed : true ,
10011003 } ;
@@ -1006,7 +1008,7 @@ fn test_import_priv_key(cl: &Client) {
10061008
10071009fn test_import_address ( cl : & Client ) {
10081010 let sk = PrivateKey {
1009- network : Network :: Regtest ,
1011+ network : Network :: Regtest . into ( ) ,
10101012 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10111013 compressed : true ,
10121014 } ;
@@ -1018,7 +1020,7 @@ fn test_import_address(cl: &Client) {
10181020
10191021fn test_import_address_script ( cl : & Client ) {
10201022 let sk = PrivateKey {
1021- network : Network :: Regtest ,
1023+ network : Network :: Regtest . into ( ) ,
10221024 inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
10231025 compressed : true ,
10241026 } ;
0 commit comments