Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions apps/labrinth/src/queue/payouts/mural.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,16 @@ pub async fn sync_failed_mural_payouts_to_labrinth(
}

fn payout_should_be_failed(payout: &muralpay::Payout) -> bool {
let muralpay::PayoutDetails::Fiat(b) = &payout.details else {
return false;
};
matches!(
payout.details,
muralpay::PayoutDetails::Fiat(muralpay::FiatPayoutDetails {
**b,
muralpay::FiatPayoutDetails {
fiat_payout_status: muralpay::FiatPayoutStatus::Failed { .. }
| muralpay::FiatPayoutStatus::Refunded { .. },
..
})
}
)
}

Expand Down Expand Up @@ -394,7 +397,7 @@ mod tests {
token_amount: dec!(10.00),
token_symbol: "USDC".into(),
},
details: PayoutDetails::Fiat(FiatPayoutDetails {
details: PayoutDetails::Fiat(Box::new(FiatPayoutDetails {
fiat_and_rail_code: FiatAndRailCode::Usd,
fiat_payout_status: FiatPayoutStatus::Pending {
initiated_at: chrono::Utc::now(),
Expand All @@ -414,7 +417,7 @@ mod tests {
token_symbol: "USDC".into(),
},
developer_fee: None,
}),
})),
recipient_info: PayoutRecipientInfo::Inline {
name: "John Smith".into(),
details: InlineRecipientDetails::Fiat {
Expand Down
6 changes: 3 additions & 3 deletions packages/muralpay/src/payout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {
crate::{
AccountId, Blockchain, CounterpartyId, CurrencyCode, FiatAccountType,
FiatAmount, FiatAndRailCode, PayoutMethodId, TokenAmount,
TransactionId, WalletDetails,
WalletDetails,
},
chrono::{DateTime, Utc},
derive_more::{Deref, Display, Error, From},
Expand Down Expand Up @@ -297,7 +297,7 @@ pub struct Payout {
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[serde(tag = "type", rename_all = "camelCase")]
pub enum PayoutDetails {
Fiat(FiatPayoutDetails),
Fiat(Box<FiatPayoutDetails>),
Blockchain(BlockchainPayoutDetails),
}

Expand Down Expand Up @@ -357,7 +357,7 @@ pub enum FiatPayoutStatus {
failure_reason: String,
refund_completed_at: DateTime<Utc>,
refund_initiated_at: DateTime<Utc>,
refund_transaction_id: TransactionId,
refund_transaction_id: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mural returns a hexadecimal address here (0x...) apparently

},
}

Expand Down