remove unclear comments

This commit is contained in:
fbock
2024-08-22 10:55:11 +02:00
parent 6d84f45499
commit dce1a05332
4 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,5 @@
use super::*; use super::*;
// Receiving this struct as input to the server
#[derive(Deserialize, Serialize, Debug, Validate)] #[derive(Deserialize, Serialize, Debug, Validate)]
pub struct OfferRequest { pub struct OfferRequest {
pub robohash_hex: String, // identifier of the trader pub robohash_hex: String, // identifier of the trader
@ -13,7 +12,6 @@ pub struct OfferRequest {
pub offer_duration_ts: u64, // unix timestamp how long the offer should stay available pub offer_duration_ts: u64, // unix timestamp how long the offer should stay available
} }
// Define a struct representing your response data
#[derive(Serialize, PartialEq, Debug, Validate)] #[derive(Serialize, PartialEq, Debug, Validate)]
pub struct BondRequirementResponse { pub struct BondRequirementResponse {
pub bond_address: String, pub bond_address: String,
@ -21,7 +19,6 @@ pub struct BondRequirementResponse {
} }
// maker step 2 // maker step 2
// (submission of signed bond and other data neccessary to coordinate the trade)
#[derive(Deserialize, Serialize, Debug)] #[derive(Deserialize, Serialize, Debug)]
pub struct BondSubmissionRequest { pub struct BondSubmissionRequest {
pub robohash_hex: String, pub robohash_hex: String,

View File

@ -53,6 +53,7 @@ pub fn agg_hex_musig_nonces(maker_nonce: &str, taker_nonce: &str) -> Result<Musi
} }
impl KeyspendContext { impl KeyspendContext {
#[allow(clippy::too_many_arguments)]
pub fn from_hex_str( pub fn from_hex_str(
maker_sig: &str, maker_sig: &str,
taker_sig: &str, taker_sig: &str,

View File

@ -385,7 +385,7 @@ pub async fn handle_payout_signature(
.map_err(|e| { .map_err(|e| {
RequestError::Database(format!( RequestError::Database(format!(
"Failed to delete complete offer from taken_offers: {}", "Failed to delete complete offer from taken_offers: {}",
e.to_string() e
)) ))
})?; })?;
Ok(true) Ok(true)

View File

@ -66,7 +66,7 @@ pub fn run_maker(maker_config: &TraderSettings) -> Result<()> {
// submit signed payout psbt back to coordinator // submit signed payout psbt back to coordinator
PayoutSignatureRequest::send(&maker_config, &signature, &offer.offer_id_hex)?; PayoutSignatureRequest::send(&maker_config, &signature, &offer.offer_id_hex)?;
} else { } else {
error!("Trade failed. Initiating escrow mode."); warn!("Trader unsatisfied. Initiating escrow mode.");
TradeObligationsUnsatisfied::request_escrow(&offer.offer_id_hex, maker_config)?; TradeObligationsUnsatisfied::request_escrow(&offer.offer_id_hex, maker_config)?;
let escrow_payout_script_psbt = IsOfferReadyRequest::poll_payout(maker_config, &offer)?; let escrow_payout_script_psbt = IsOfferReadyRequest::poll_payout(maker_config, &offer)?;
} }
@ -110,7 +110,7 @@ pub fn run_taker(taker_config: &TraderSettings) -> Result<()> {
PayoutSignatureRequest::send(&taker_config, &signature, &accepted_offer.offer_id_hex)?; PayoutSignatureRequest::send(&taker_config, &signature, &accepted_offer.offer_id_hex)?;
// here we need to handle if the other party is not cooperating // here we need to handle if the other party is not cooperating
} else { } else {
error!("Trade failed."); error!("Trader unsatisfied. Initiating escrow mode.");
panic!("Escrow to be implemented!"); panic!("Escrow to be implemented!");
} }
Ok(()) Ok(())