Skip to content

Commit

Permalink
change query
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMenko committed Oct 19, 2023
1 parent d40fa8f commit 22ce1c8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use std::collections::HashSet;
use anyhow::{anyhow, Context, Error as ErrReport};
use chrono::{DateTime, Utc};
use clap::Parser;
use ruint::aliases::U256;
use semaphore::Field;
use sqlx::migrate::{Migrate, MigrateDatabase, Migrator};
use sqlx::pool::PoolOptions;
use sqlx::{Executor, Pool, Postgres, Row};
Expand Down Expand Up @@ -336,7 +334,7 @@ impl Database {
pub async fn get_latest_root_by_status(&self, status: Status) -> Result<Option<Hash>, Error> {
let query = sqlx::query(
r#"
SELECT root from identities where status = $1 ORDER BY leaf_index DESC LIMIT 1
SELECT root FROM identities WHERE status = $1 ORDER BY id DESC LIMIT 1
"#,
)
.bind(<&str>::from(status));
Expand Down

0 comments on commit 22ce1c8

Please sign in to comment.