From d5c73158127b348c99c47f159938505999f792b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pier=C5=9Bcionek?= Date: Tue, 26 Sep 2023 11:36:15 +0200 Subject: [PATCH] add txn_participation.round filter --- idb/postgres/postgres.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/idb/postgres/postgres.go b/idb/postgres/postgres.go index d0918eda7..b36686670 100644 --- a/idb/postgres/postgres.go +++ b/idb/postgres/postgres.go @@ -510,6 +510,16 @@ func buildTransactionQuery(tf idb.TransactionFilter) (query string, whereArgs [] whereParts = append(whereParts, fmt.Sprintf("p.addr = $%d", partNumber)) whereArgs = append(whereArgs, tf.Address) partNumber++ + if tf.MinRound != 0 { + whereParts = append(whereParts, fmt.Sprintf("p.round >= $%d", partNumber)) + whereArgs = append(whereArgs, tf.MinRound) + partNumber++ + } + if tf.MaxRound != 0 { + whereParts = append(whereParts, fmt.Sprintf("p.round <= $%d", partNumber)) + whereArgs = append(whereArgs, tf.MaxRound) + partNumber++ + } if tf.AddressRole != 0 { addrBase64 := encoding.Base64(tf.Address) roleparts := make([]string, 0, 8)