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::*;
// Receiving this struct as input to the server
#[derive(Deserialize, Serialize, Debug, Validate)]
pub struct OfferRequest {
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
}
// Define a struct representing your response data
#[derive(Serialize, PartialEq, Debug, Validate)]
pub struct BondRequirementResponse {
pub bond_address: String,
@ -21,7 +19,6 @@ pub struct BondRequirementResponse {
}
// maker step 2
// (submission of signed bond and other data neccessary to coordinate the trade)
#[derive(Deserialize, Serialize, Debug)]
pub struct BondSubmissionRequest {
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 {
#[allow(clippy::too_many_arguments)]
pub fn from_hex_str(
maker_sig: &str,
taker_sig: &str,

View File

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

View File

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