@@ -177,18 +177,18 @@ impl BitcoinClientApi for BitcoinClient {
177
177
}
178
178
179
179
fn get_address_to_pay ( & self , bill_public_key : & str , holder_public_key : & str ) -> Result < String > {
180
- let public_key_bill = bitcoin:: PublicKey :: from_str ( bill_public_key)
180
+ let public_key_bill = bitcoin:: CompressedPublicKey :: from_str ( bill_public_key)
181
181
. map_err ( |e| Error :: PublicKey ( e. to_string ( ) ) ) ?;
182
- let public_key_bill_holder = bitcoin:: PublicKey :: from_str ( holder_public_key)
182
+ let public_key_bill_holder = bitcoin:: CompressedPublicKey :: from_str ( holder_public_key)
183
183
. map_err ( |e| Error :: PublicKey ( e. to_string ( ) ) ) ?;
184
184
185
185
let public_key_bill = public_key_bill
186
- . inner
187
- . combine ( & public_key_bill_holder. inner )
186
+ . 0
187
+ . combine ( & public_key_bill_holder. 0 )
188
188
. map_err ( Error :: from) ?;
189
- let pub_key_bill = bitcoin:: PublicKey :: new ( public_key_bill) ;
189
+ let pub_key_bill = bitcoin:: CompressedPublicKey ( public_key_bill) ;
190
190
191
- Ok ( bitcoin:: Address :: p2pkh ( pub_key_bill, get_config ( ) . bitcoin_network ( ) ) . to_string ( ) )
191
+ Ok ( bitcoin:: Address :: p2wpkh ( & pub_key_bill, get_config ( ) . bitcoin_network ( ) ) . to_string ( ) )
192
192
}
193
193
194
194
fn generate_link_to_pay ( & self , address : & str , sum : u64 , message : & str ) -> String {
@@ -217,7 +217,7 @@ impl BitcoinClientApi for BitcoinClient {
217
217
desc_pubkey. clone ( ) ,
218
218
desc_seckey,
219
219
) ) ) ;
220
- let desc = miniscript:: Descriptor :: new_pkh ( desc_pubkey) . unwrap ( ) ;
220
+ let desc = miniscript:: Descriptor :: new_wpkh ( desc_pubkey) . unwrap ( ) ;
221
221
Ok ( desc. to_string_with_secret ( & kmap) )
222
222
}
223
223
0 commit comments