Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssuchichan committed Jun 30, 2024
1 parent 350a61c commit e2fe32e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions explorer/src/service/v2/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ pub async fn get_blocks(
) -> Result<Json<QueryResult<Vec<BlockResponse>>>> {
let mut pool = state.pool.acquire().await?;
let page = params.page.unwrap_or(1);
let page_size = params.page_size.unwrap_or(0);
let page_size = params.page_size.unwrap_or(10);

let sql_total = "SELECT max(height) FROM block";
let row = sqlx::query(sql_total).fetch_one(&mut *pool).await?;
let total = row.try_get("max").unwrap_or(10);
let total = row.try_get("max").unwrap_or(0);

let sql_query = r#"SELECT block_hash,height,size,tx_count,time,app_hash,proposer,block_data
FROM block ORDER BY height DESC LIMIT $1 OFFSET $2"#;
Expand Down

0 comments on commit e2fe32e

Please sign in to comment.