Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinyuchan committed Mar 18, 2024
1 parent 5025693 commit 601df87
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions indexer/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,17 +519,22 @@ pub async fn get_sum(
.bind(addr)
.fetch_one(&mut *pool)
.await?
.try_get("s")?;
.try_get("s")
.unwrap_or(BigDecimal::from(0));

let sum_undelegate: BigDecimal = sqlx::query(sql_undelegate)
.bind(addr)
.fetch_one(&mut *pool)
.await?
.try_get("s")?;
.try_get("s")
.unwrap_or(BigDecimal::from(0));

let sum_claim: BigDecimal = sqlx::query(sql_claim)
.bind(addr)
.fetch_one(&mut *pool)
.await?
.try_get("s")?;
.try_get("s")
.unwrap_or(BigDecimal::from(0));

Ok(Json(DelegatorSum {
sum_delegate: sum_delegate.to_string(),
Expand Down

0 comments on commit 601df87

Please sign in to comment.