mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-29 12:06:35 -05:00
Remove BuildTxLockPsbt and GetNetwork traits
These traits were only used once within the `TxLock` constructor. Looking at the rest of the codebase, we don't really seem to follow any abstractions here where the protocol shouldn't know about the exact types that is being passed in. As such, these types are just noise and might as well be removed in favor of simplicity.
This commit is contained in:
parent
6c38d66864
commit
67fe01a2ef
4 changed files with 14 additions and 44 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use crate::bitcoin::{
|
||||
build_shared_output_descriptor, Address, Amount, BuildTxLockPsbt, GetNetwork, PublicKey,
|
||||
Transaction, TX_FEE,
|
||||
build_shared_output_descriptor, Address, Amount, PublicKey, Transaction, Wallet, TX_FEE,
|
||||
};
|
||||
use ::bitcoin::{util::psbt::PartiallySignedTransaction, OutPoint, TxIn, TxOut, Txid};
|
||||
use anyhow::Result;
|
||||
|
|
@ -14,10 +13,7 @@ pub struct TxLock {
|
|||
}
|
||||
|
||||
impl TxLock {
|
||||
pub async fn new<W>(wallet: &W, amount: Amount, A: PublicKey, B: PublicKey) -> Result<Self>
|
||||
where
|
||||
W: BuildTxLockPsbt + GetNetwork,
|
||||
{
|
||||
pub async fn new(wallet: &Wallet, amount: Amount, A: PublicKey, B: PublicKey) -> Result<Self> {
|
||||
let lock_output_descriptor = build_shared_output_descriptor(A.0, B.0);
|
||||
let address = lock_output_descriptor
|
||||
.address(wallet.get_network().await)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue