Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinZavior committed Oct 17, 2023
1 parent a0301f7 commit fec4647
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl ProvisionalProposal {
let mut guard = self.get_proposal_mutex_guard();
match guard.as_mut().unwrap().try_preserving_privacy(_candidate_inputs) {
Ok(e) => Ok(OutPoint { txid: e.txid.to_string(), vout: e.vout }),
Err(_) => Err(PayjoinError::SelectionError),
Err(e) => Err(PayjoinError::SelectionError { message: format!("{:?}", e) }),
}
}

Expand All @@ -360,7 +360,7 @@ impl ProvisionalProposal {
min_feerate_sat_per_vb.map(|x| (*x).into()),
) {
Ok(e) => Ok(Arc::new(PayjoinProposal { internal: e })),
Err(_) => Err(PayjoinError::SelectionError),
Err(e) => Err(PayjoinError::UnexpectedError { message: e.to_string() }),
}
}
}
Expand All @@ -387,11 +387,11 @@ impl PayjoinProposal {
pub fn is_output_substitution_disabled(&self) -> bool {
self.internal.is_output_substitution_disabled()
}
pub fn owned_vouts(&self) -> Vec<usize> {
self.internal.owned_vouts().clone()
pub fn owned_vouts(&self) -> Vec<u64> {
self.internal.owned_vouts().iter().map(|x| *x as u64).collect()
}
pub fn psbt(&self) -> PartiallySignedTransaction {
self.internal.psbt().clone().into()
pub fn psbt(&self) -> Arc<PartiallySignedTransaction> {
Arc::new(self.internal.psbt().clone().into())
}
}

Expand All @@ -410,8 +410,8 @@ mod test {
// | P2SH-P2WPKH | 2 sat/vbyte | 0.00000182 | 0 |
let original_psbt =
"cHNidP8BAHMCAAAAAY8nutGgJdyYGXWiBEb45Hoe9lWGbkxh/6bNiOJdCDuDAAAAAAD+////AtyVuAUAAAAAF6kUHehJ8GnSdBUOOv6ujXLrWmsJRDCHgIQeAAAAAAAXqRR3QJbbz0hnQ8IvQ0fptGn+votneofTAAAAAAEBIKgb1wUAAAAAF6kU3k4ekGHKWRNbA1rV5tR5kEVDVNCHAQcXFgAUx4pFclNVgo1WWAdN1SYNX8tphTABCGsCRzBEAiB8Q+A6dep+Rz92vhy26lT0AjZn4PRLi8Bf9qoB/CMk0wIgP/Rj2PWZ3gEjUkTlhDRNAQ0gXwTO7t9n+V14pZ6oljUBIQMVmsAaoNWHVMS02LfTSe0e388LNitPa1UQZyOihY+FFgABABYAFEb2Giu6c4KO5YW0pfw3lGp9jMUUAAA=";

let body = original_psbt.as_bytes();

let headers = Headers::from_vec(body.to_vec());
UncheckedProposal::from_request(
body.to_vec(),
Expand Down

0 comments on commit fec4647

Please sign in to comment.