Skip to content

Commit

Permalink
post rebase fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop committed Oct 14, 2024
1 parent d9ddc2d commit 1b9c0a2
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/database/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use sqlx::{Executor, Postgres, Row};
use tracing::instrument;
use types::{DeletionEntry, LatestDeletionEntry, RecoveryEntry};

use crate::database::types::{
BatchEntry, BatchEntryData, BatchType, LatestInsertionEntry, TransactionEntry,
};
use crate::database::types::{BatchEntry, BatchEntryData, BatchType, LatestInsertionEntry};
use crate::database::{types, Error};
use crate::identity_tree::{
Hash, ProcessedStatus, RootItem, TreeItem, TreeUpdate, UnprocessedStatus,
Expand Down Expand Up @@ -186,17 +184,6 @@ pub trait DatabaseQuery<'a>: Executor<'a, Database = Postgres> {
.collect())
}

async fn get_latest_root(self) -> Result<Option<Hash>, Error> {
Ok(sqlx::query(
r#"
SELECT root FROM identities ORDER BY id DESC LIMIT 1
"#,
)
.fetch_optional(self)
.await?
.map(|r| r.get::<Hash, _>(0)))
}

async fn get_latest_root_by_status(
self,
status: ProcessedStatus,
Expand Down Expand Up @@ -621,7 +608,7 @@ pub trait DatabaseQuery<'a>: Executor<'a, Database = Postgres> {
.bind(BatchType::Insertion)
.bind(sqlx::types::Json::from(BatchEntryData {
identities: vec![],
indexes: vec![],
indexes: vec![],
}));

self.execute(query).await?;
Expand Down Expand Up @@ -653,7 +640,7 @@ pub trait DatabaseQuery<'a>: Executor<'a, Database = Postgres> {
.bind(batch_type)
.bind(sqlx::types::Json::from(BatchEntryData {
identities: identities.to_vec(),
indexes: indexes.to_vec(),
indexes: indexes.to_vec(),
}));

self.execute(query).await?;
Expand Down

0 comments on commit 1b9c0a2

Please sign in to comment.