You've already forked AstralRinth
forked from didirus/AstralRinth
Fix tremendous balance check (#4337)
This commit is contained in:
committed by
GitHub
parent
8f8a4af9eb
commit
0511a14bd9
@@ -651,8 +651,8 @@ impl PayoutsQueue {
|
|||||||
) -> Result<Option<AccountBalance>, ApiError> {
|
) -> Result<Option<AccountBalance>, ApiError> {
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct FundingSourceMeta {
|
struct FundingSourceMeta {
|
||||||
available_cents: u64,
|
available_cents: Option<u64>,
|
||||||
pending_cents: u64,
|
pending_cents: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
@@ -679,9 +679,9 @@ impl PayoutsQueue {
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
.find(|x| x.method == "balance")
|
.find(|x| x.method == "balance")
|
||||||
.map(|x| AccountBalance {
|
.map(|x| AccountBalance {
|
||||||
available: Decimal::from(x.meta.available_cents)
|
available: Decimal::from(x.meta.available_cents.unwrap_or(0))
|
||||||
/ Decimal::from(100),
|
/ Decimal::from(100),
|
||||||
pending: Decimal::from(x.meta.pending_cents)
|
pending: Decimal::from(x.meta.pending_cents.unwrap_or(0))
|
||||||
/ Decimal::from(100),
|
/ Decimal::from(100),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user