@@ -28,8 +28,8 @@ use bitcoin::hashes::hex::FromHex;
28
28
use bitcoin:: hashes:: Hash ;
29
29
use bitcoin:: { secp256k1, sighash, ScriptBuf } ;
30
30
use 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 ,
33
33
} ;
34
34
use bitcoincore_rpc:: bitcoincore_rpc_json:: {
35
35
GetBlockTemplateModes , GetBlockTemplateRules , GetZmqNotificationsResult , ScanTxOutRequest ,
@@ -270,7 +270,8 @@ fn test_get_raw_change_address(cl: &Client) {
270
270
fn test_dump_private_key ( cl : & Client ) {
271
271
let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
272
272
let sk = cl. dump_private_key ( & addr) . unwrap ( ) ;
273
- assert_eq ! ( addr, Address :: p2wpkh( & sk. public_key( & SECP ) , * NET ) . unwrap( ) ) ;
273
+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
274
+ assert_eq ! ( addr, Address :: p2wpkh( & pk, * NET ) ) ;
274
275
}
275
276
276
277
fn test_generate ( cl : & Client ) {
@@ -590,11 +591,12 @@ fn test_get_block_filter(cl: &Client) {
590
591
591
592
fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
592
593
let sk = PrivateKey {
593
- network : Network :: Regtest ,
594
+ network : Network :: Regtest . into ( ) ,
594
595
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
595
596
compressed : true ,
596
597
} ;
597
- let addr = Address :: p2wpkh ( & sk. public_key ( & SECP ) , Network :: Regtest ) . unwrap ( ) ;
598
+ let pk = CompressedPublicKey :: from_private_key ( & SECP , & sk) . unwrap ( ) ;
599
+ let addr = Address :: p2wpkh ( & pk, Network :: Regtest ) ;
598
600
599
601
let options = json:: ListUnspentQueryOptions {
600
602
minimum_amount : Some ( btc ( 2 ) ) ,
@@ -718,7 +720,7 @@ fn test_decode_raw_transaction(cl: &Client) {
718
720
719
721
let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
720
722
721
- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
723
+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
722
724
assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
723
725
724
726
assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -1008,7 +1010,7 @@ fn test_list_received_by_address(cl: &Client) {
1008
1010
1009
1011
fn test_import_public_key ( cl : & Client ) {
1010
1012
let sk = PrivateKey {
1011
- network : Network :: Regtest ,
1013
+ network : Network :: Regtest . into ( ) ,
1012
1014
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1013
1015
compressed : true ,
1014
1016
} ;
@@ -1019,7 +1021,7 @@ fn test_import_public_key(cl: &Client) {
1019
1021
1020
1022
fn test_import_priv_key ( cl : & Client ) {
1021
1023
let sk = PrivateKey {
1022
- network : Network :: Regtest ,
1024
+ network : Network :: Regtest . into ( ) ,
1023
1025
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1024
1026
compressed : true ,
1025
1027
} ;
@@ -1030,7 +1032,7 @@ fn test_import_priv_key(cl: &Client) {
1030
1032
1031
1033
fn test_import_address ( cl : & Client ) {
1032
1034
let sk = PrivateKey {
1033
- network : Network :: Regtest ,
1035
+ network : Network :: Regtest . into ( ) ,
1034
1036
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1035
1037
compressed : true ,
1036
1038
} ;
@@ -1042,7 +1044,7 @@ fn test_import_address(cl: &Client) {
1042
1044
1043
1045
fn test_import_address_script ( cl : & Client ) {
1044
1046
let sk = PrivateKey {
1045
- network : Network :: Regtest ,
1047
+ network : Network :: Regtest . into ( ) ,
1046
1048
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1047
1049
compressed : true ,
1048
1050
} ;
0 commit comments