@@ -28,7 +28,7 @@ use bitcoin::hashes::hex::FromHex;
28
28
use bitcoin:: hashes:: Hash ;
29
29
use bitcoin:: { secp256k1, ScriptBuf , sighash} ;
30
30
use bitcoin:: {
31
- transaction, Address , Amount , Network , OutPoint , PrivateKey , Sequence , SignedAmount ,
31
+ transaction, Address , Amount , CompressedPublicKey , Network , OutPoint , PrivateKey , Sequence , SignedAmount ,
32
32
Transaction , TxIn , TxOut , Txid , Witness ,
33
33
} ;
34
34
use bitcoincore_rpc:: bitcoincore_rpc_json:: {
@@ -267,7 +267,8 @@ fn test_get_raw_change_address(cl: &Client) {
267
267
fn test_dump_private_key ( cl : & Client ) {
268
268
let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
269
269
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 ) ) ;
271
272
}
272
273
273
274
fn test_generate ( cl : & Client ) {
@@ -570,11 +571,12 @@ fn test_get_block_filter(cl: &Client) {
570
571
571
572
fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
572
573
let sk = PrivateKey {
573
- network : Network :: Regtest ,
574
+ network : Network :: Regtest . into ( ) ,
574
575
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
575
576
compressed : true ,
576
577
} ;
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 ) ;
578
580
579
581
let options = json:: ListUnspentQueryOptions {
580
582
minimum_amount : Some ( btc ( 2 ) ) ,
@@ -693,7 +695,7 @@ fn test_decode_raw_transaction(cl: &Client) {
693
695
694
696
let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
695
697
696
- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
698
+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
697
699
assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
698
700
699
701
assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -983,7 +985,7 @@ fn test_list_received_by_address(cl: &Client) {
983
985
984
986
fn test_import_public_key ( cl : & Client ) {
985
987
let sk = PrivateKey {
986
- network : Network :: Regtest ,
988
+ network : Network :: Regtest . into ( ) ,
987
989
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
988
990
compressed : true ,
989
991
} ;
@@ -994,7 +996,7 @@ fn test_import_public_key(cl: &Client) {
994
996
995
997
fn test_import_priv_key ( cl : & Client ) {
996
998
let sk = PrivateKey {
997
- network : Network :: Regtest ,
999
+ network : Network :: Regtest . into ( ) ,
998
1000
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
999
1001
compressed : true ,
1000
1002
} ;
@@ -1005,7 +1007,7 @@ fn test_import_priv_key(cl: &Client) {
1005
1007
1006
1008
fn test_import_address ( cl : & Client ) {
1007
1009
let sk = PrivateKey {
1008
- network : Network :: Regtest ,
1010
+ network : Network :: Regtest . into ( ) ,
1009
1011
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1010
1012
compressed : true ,
1011
1013
} ;
@@ -1017,7 +1019,7 @@ fn test_import_address(cl: &Client) {
1017
1019
1018
1020
fn test_import_address_script ( cl : & Client ) {
1019
1021
let sk = PrivateKey {
1020
- network : Network :: Regtest ,
1022
+ network : Network :: Regtest . into ( ) ,
1021
1023
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1022
1024
compressed : true ,
1023
1025
} ;
0 commit comments