Skip to content

Commit 37ad00c

Browse files
committed
fix: lowercase address when selecting and insert in db
1 parent b79bd9f commit 37ad00c

File tree

1 file changed

+4
-4
lines changed
  • aggregation_mode/batcher/src

1 file changed

+4
-4
lines changed

aggregation_mode/batcher/src/db.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl Db {
2828
pub async fn count_proofs_by_address(&self, address: &str) -> Result<i64, sqlx::Error> {
2929
let (count,) =
3030
sqlx::query_as::<_, (i64,)>("SELECT COUNT(*) FROM proofs WHERE address = $1")
31-
.bind(address)
31+
.bind(address.to_lowercase())
3232
.fetch_one(&self.pool)
3333
.await?;
3434

@@ -66,7 +66,7 @@ impl Db {
6666
) VALUES ($1, $2, $3, $4, $5)
6767
RETURNING proof_id",
6868
)
69-
.bind(address)
69+
.bind(address.to_lowercase())
7070
.bind(proving_system_id)
7171
.bind(proof)
7272
.bind(program_commitment)
@@ -88,7 +88,7 @@ impl Db {
8888
VALUES ($1, $2, $3, $4, $5)
8989
ON CONFLICT (tx_hash) DO NOTHING",
9090
)
91-
.bind(address)
91+
.bind(address.to_lowercase())
9292
.bind(started_at)
9393
.bind(amount)
9494
.bind(valid_until)
@@ -109,7 +109,7 @@ impl Db {
109109
WHERE address = $1 AND started_at < $2 AND $2 < valid_until
110110
)",
111111
)
112-
.bind(address)
112+
.bind(address.to_lowercase())
113113
.bind(epoch)
114114
.fetch_one(&self.pool)
115115
.await

0 commit comments

Comments
 (0)