@@ -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:: {
@@ -268,7 +268,8 @@ fn test_get_raw_change_address(cl: &Client) {
268
268
fn test_dump_private_key ( cl : & Client ) {
269
269
let addr = cl. get_new_address ( None , Some ( json:: AddressType :: Bech32 ) ) . unwrap ( ) . assume_checked ( ) ;
270
270
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 ) ) ;
272
273
}
273
274
274
275
fn test_generate ( cl : & Client ) {
@@ -571,11 +572,12 @@ fn test_get_block_filter(cl: &Client) {
571
572
572
573
fn test_sign_raw_transaction_with_send_raw_transaction ( cl : & Client ) {
573
574
let sk = PrivateKey {
574
- network : Network :: Regtest ,
575
+ network : Network :: Regtest . into ( ) ,
575
576
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
576
577
compressed : true ,
577
578
} ;
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 ) ;
579
581
580
582
let options = json:: ListUnspentQueryOptions {
581
583
minimum_amount : Some ( btc ( 2 ) ) ,
@@ -694,7 +696,7 @@ fn test_decode_raw_transaction(cl: &Client) {
694
696
695
697
let decoded_transaction = cl. decode_raw_transaction ( hex, None ) . unwrap ( ) ;
696
698
697
- assert_eq ! ( tx. txid ( ) , decoded_transaction. txid) ;
699
+ assert_eq ! ( tx. compute_txid ( ) , decoded_transaction. txid) ;
698
700
assert_eq ! ( 500_000 , decoded_transaction. locktime) ;
699
701
700
702
assert_eq ! ( decoded_transaction. vin[ 0 ] . txid. unwrap( ) , unspent. txid) ;
@@ -984,7 +986,7 @@ fn test_list_received_by_address(cl: &Client) {
984
986
985
987
fn test_import_public_key ( cl : & Client ) {
986
988
let sk = PrivateKey {
987
- network : Network :: Regtest ,
989
+ network : Network :: Regtest . into ( ) ,
988
990
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
989
991
compressed : true ,
990
992
} ;
@@ -995,7 +997,7 @@ fn test_import_public_key(cl: &Client) {
995
997
996
998
fn test_import_priv_key ( cl : & Client ) {
997
999
let sk = PrivateKey {
998
- network : Network :: Regtest ,
1000
+ network : Network :: Regtest . into ( ) ,
999
1001
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1000
1002
compressed : true ,
1001
1003
} ;
@@ -1006,7 +1008,7 @@ fn test_import_priv_key(cl: &Client) {
1006
1008
1007
1009
fn test_import_address ( cl : & Client ) {
1008
1010
let sk = PrivateKey {
1009
- network : Network :: Regtest ,
1011
+ network : Network :: Regtest . into ( ) ,
1010
1012
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1011
1013
compressed : true ,
1012
1014
} ;
@@ -1018,7 +1020,7 @@ fn test_import_address(cl: &Client) {
1018
1020
1019
1021
fn test_import_address_script ( cl : & Client ) {
1020
1022
let sk = PrivateKey {
1021
- network : Network :: Regtest ,
1023
+ network : Network :: Regtest . into ( ) ,
1022
1024
inner : secp256k1:: SecretKey :: new ( & mut secp256k1:: rand:: thread_rng ( ) ) ,
1023
1025
compressed : true ,
1024
1026
} ;
0 commit comments