@@ -29,8 +29,8 @@ use bitcoin::hashes::Hash;
29
29
use bitcoin:: sign_message:: MessageSignature ;
30
30
use bitcoin:: { secp256k1, sighash, ScriptBuf } ;
31
31
use 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 ,
34
34
} ;
35
35
use bitcoincore_rpc:: bitcoincore_rpc_json:: {
36
36
GetBlockTemplateModes , GetBlockTemplateRules , GetZmqNotificationsResult , ScanTxOutRequest ,
@@ -272,7 +272,8 @@ fn test_get_raw_change_address(cl: &Client) {
272
272
fn test_dump_private_key ( cl : & Client ) {
273
273
let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
274
274
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 ) ) ;
276
277
}
277
278
278
279
fn test_generate ( cl : & Client ) {
@@ -592,11 +593,12 @@ fn test_get_block_filter(cl: &Client) {
592
593
593
594
fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
594
595
let sk = PrivateKey {
595
- network : Network :: Regtest ,
596
+ network : Network :: Regtest . into ( ) ,
596
597
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
597
598
compressed : true ,
598
599
} ;
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 ) ;
600
602
601
603
let options = json:: ListUnspentQueryOptions {
602
604
minimum_amount : Some ( btc ( 2 ) ) ,
@@ -720,7 +722,7 @@ fn test_decode_raw_transaction(cl: &Client) {
720
722
721
723
let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
722
724
723
- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
725
+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
724
726
assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
725
727
726
728
assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -1010,7 +1012,7 @@ fn test_list_received_by_address(cl: &Client) {
1010
1012
1011
1013
fn test_import_public_key ( cl : & Client ) {
1012
1014
let sk = PrivateKey {
1013
- network : Network :: Regtest ,
1015
+ network : Network :: Regtest . into ( ) ,
1014
1016
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1015
1017
compressed : true ,
1016
1018
} ;
@@ -1021,7 +1023,7 @@ fn test_import_public_key(cl: &Client) {
1021
1023
1022
1024
fn test_import_priv_key ( cl : & Client ) {
1023
1025
let sk = PrivateKey {
1024
- network : Network :: Regtest ,
1026
+ network : Network :: Regtest . into ( ) ,
1025
1027
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1026
1028
compressed : true ,
1027
1029
} ;
@@ -1032,7 +1034,7 @@ fn test_import_priv_key(cl: &Client) {
1032
1034
1033
1035
fn test_import_address ( cl : & Client ) {
1034
1036
let sk = PrivateKey {
1035
- network : Network :: Regtest ,
1037
+ network : Network :: Regtest . into ( ) ,
1036
1038
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1037
1039
compressed : true ,
1038
1040
} ;
@@ -1044,7 +1046,7 @@ fn test_import_address(cl: &Client) {
1044
1046
1045
1047
fn test_import_address_script ( cl : & Client ) {
1046
1048
let sk = PrivateKey {
1047
- network : Network :: Regtest ,
1049
+ network : Network :: Regtest . into ( ) ,
1048
1050
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1049
1051
compressed : true ,
1050
1052
} ;
0 commit comments