Skip to content

Commit

Permalink
fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Nov 2, 2023
1 parent 3de99ae commit 838911d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion mm2src/coins/utxo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ use futures::lock::{Mutex as AsyncMutex, MutexGuard as AsyncMutexGuard};
use futures01::Future;
use keys::bytes::Bytes;
use keys::NetworkAddressPrefixes;
use keys::Signature;
pub use keys::{Address, AddressFormat as UtxoAddressFormat, AddressHashEnum, AddressPrefixes, AddressScriptType,
KeyPair, LegacyAddress, Private, Public, Secret, Type as ScriptType};
KeyPair, LegacyAddress, Private, Public, Secret};
#[cfg(not(target_arch = "wasm32"))]
use lightning_invoice::Currency as LightningCurrency;
use mm2_core::mm_ctx::MmArc;
Expand Down
9 changes: 4 additions & 5 deletions mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ pub fn addresses_from_script<T: UtxoCommonOps>(coin: &T, script: &Script) -> Res
AddressScriptType::P2WSH,
),
};
println!("prefixes={:?}", prefixes);
Address {
hash: dst.hash,
checksum_type: conf.checksum_type,
Expand Down Expand Up @@ -1461,10 +1460,10 @@ pub async fn sign_and_send_taker_funding_spend<T: UtxoCommonOps>(
let payment_address = Address {
checksum_type: coin.as_ref().conf.checksum_type,
hash: AddressHashEnum::AddressHash(dhash160(&payment_redeem_script)),
prefix: coin.as_ref().conf.p2sh_addr_prefix,
t_addr_prefix: coin.as_ref().conf.p2sh_t_addr_prefix,
prefixes: coin.as_ref().conf.address_prefixes.p2sh.clone(),
hrp: coin.as_ref().conf.bech32_hrp.clone(),
addr_format: UtxoAddressFormat::Standard,
script_type: AddressScriptType::P2SH,
};
let payment_address_str = payment_address.to_string();
try_tx_s!(
Expand Down Expand Up @@ -2548,7 +2547,7 @@ pub fn validate_payment_spend_or_refund<T: UtxoCommonOps + SwapOps>(
payment_spend_tx.tx_hash_algo = coin.as_ref().tx_hash_algo;

let my_address = try_f!(coin.as_ref().derivation_method.single_addr_or_err());
let expected_script_pubkey = &output_script(my_address, ScriptType::P2PKH).to_bytes();
let expected_script_pubkey = &output_script(my_address).to_bytes();
let output = try_f!(payment_spend_tx
.outputs
.get(DEFAULT_SWAP_VOUT)
Expand Down Expand Up @@ -4900,7 +4899,7 @@ where
payment_value
);
}
let script_pubkey = output_script(&my_address, ScriptType::P2PKH).to_bytes();
let script_pubkey = output_script(&my_address).to_bytes();
let output = TransactionOutput {
value: payment_value - fee,
script_pubkey,
Expand Down
3 changes: 2 additions & 1 deletion mm2src/coins/utxo/utxo_common_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crypto::privkey::key_pair_from_seed;
use itertools::Itertools;
use keys::prefixes::*;
use mm2_test_helpers::for_tests::mm_ctx_with_custom_db;
use std::convert::TryFrom;
use std::num::NonZeroUsize;
use std::time::Duration;

Expand Down Expand Up @@ -219,7 +220,7 @@ pub(super) async fn test_electrum_display_balances(rpc_client: &ElectrumClient)
(
Address::from_legacyaddress("RYPz6Lr4muj4gcFzpMdv3ks1NCGn3mkDPN", &KMD_PREFIXES.try_into().unwrap())
.unwrap(),
BigDecimal::from(3.33),
BigDecimal::try_from(3.33).unwrap(),
),
(
Address::from_legacyaddress("RJeDDtDRtKUoL8BCKdH7TNCHqUKr7kQRsi", &KMD_PREFIXES.try_into().unwrap())
Expand Down

0 comments on commit 838911d

Please sign in to comment.