Skip to content

Commit

Permalink
moved identity_is_queued_for_deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
0xForerunner committed Feb 13, 2024
1 parent cfce7e5 commit e529558
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,6 @@ impl Database {
.into_iter()
.collect())
}

// TODO: add docs
pub async fn identity_is_queued_for_deletion(&self, commitment: &Hash) -> Result<bool, Error> {
let query_queued_deletion =
sqlx::query(r#"SELECT exists(SELECT 1 FROM deletions where commitment = $1)"#)
.bind(commitment);
let row_unprocessed = self.pool.fetch_one(query_queued_deletion).await?;
Ok(row_unprocessed.get::<bool, _>(0))
}
}

/// This trait provides the individual and composable queries to the database.
Expand Down Expand Up @@ -832,6 +823,15 @@ pub trait DatabaseExt<'a>: Executor<'a, Database = Postgres> {
.await?
.get::<bool, _>(0))
}

// TODO: add docs
async fn identity_is_queued_for_deletion(self, commitment: &Hash) -> Result<bool, Error> {

Check failure on line 828 in src/database/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

functions in traits cannot be declared `async`

error[E0706]: functions in traits cannot be declared `async` --> src/database/mod.rs:828:5 | 828 | async fn identity_is_queued_for_deletion(self, commitment: &Hash) -> Result<bool, Error> { | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `async` because of this | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
let query_queued_deletion =
sqlx::query(r#"SELECT exists(SELECT 1 FROM deletions where commitment = $1)"#)
.bind(commitment);
let row_unprocessed = self.fetch_one(query_queued_deletion).await?;
Ok(row_unprocessed.get::<bool, _>(0))
}
}

#[derive(Debug, Error)]
Expand Down

0 comments on commit e529558

Please sign in to comment.