Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContractTxInfo construction into helper functions in Signature Request Methods #260

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions src/taker/routines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ pub(crate) fn req_sigs_for_sender_once<S: SwapCoin>(
socket.peer_addr()?
);

// TODO: Take this construction out of function body.
wthrajat marked this conversation as resolved.
Show resolved Hide resolved
let txs_info = maker_multisig_nonces
.iter()
.zip(maker_hashlock_nonces.iter())
Expand Down Expand Up @@ -182,19 +181,18 @@ pub(crate) fn req_sigs_for_recvr_once<S: SwapCoin>(
log::info!("Connecting to {}", socket.peer_addr()?);
handshake_maker(socket)?;

// TODO: Take the message construction out of function body.
let txs_info = incoming_swapcoins
.iter()
.zip(receivers_contract_txes.iter())
.map(|(swapcoin, receivers_contract_tx)| ContractTxInfoForRecvr {
multisig_redeemscript: swapcoin.get_multisig_redeemscript(),
contract_tx: receivers_contract_tx.clone(),
})
.collect::<Vec<ContractTxInfoForRecvr>>();

send_message(
socket,
&TakerToMakerMessage::ReqContractSigsForRecvr(ReqContractSigsForRecvr {
txs: incoming_swapcoins
.iter()
.zip(receivers_contract_txes.iter())
.map(|(swapcoin, receivers_contract_tx)| ContractTxInfoForRecvr {
multisig_redeemscript: swapcoin.get_multisig_redeemscript(),
contract_tx: receivers_contract_tx.clone(),
})
.collect::<Vec<ContractTxInfoForRecvr>>(),
}),
&TakerToMakerMessage::ReqContractSigsForRecvr(ReqContractSigsForRecvr { txs: txs_info }),
)?;

let msg_bytes = read_message(socket)?;
Expand Down
Loading