From 906c3d9d50a0bd53b5ee38c28ec407bc102b4c36 Mon Sep 17 00:00:00 2001
From: Jasmina Malicevic
Date: Wed, 14 Dec 2022 15:00:20 +0100
Subject: [PATCH] Fixed ordering of match.events in light client RPC
---
light/proxy/routes.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/light/proxy/routes.go b/light/proxy/routes.go
index 6874a26e2f9..df15f06ee91 100644
--- a/light/proxy/routes.go
+++ b/light/proxy/routes.go
@@ -160,7 +160,7 @@ func makeTxSearchFuncMatchEvents(c *lrpc.Client) rpcTxSearchFuncMatchEvents {
matchEvents bool,
) (*ctypes.ResultTxSearch, error) {
if matchEvents {
- query = query + " AND match.events = 1"
+ query = "match.events = 1 AND " + query
}
return c.TxSearch(ctx.Context(), query, prove, page, perPage, orderBy)
}
@@ -185,7 +185,7 @@ func makeBlockSearchFuncMatchEvents(c *lrpc.Client) rpcBlockSearchFuncMatchEvent
matchEvents bool,
) (*ctypes.ResultBlockSearch, error) {
if matchEvents {
- query = query + " AND match.events = 1"
+ query = "match.events = 1 AND " + query
}
return c.BlockSearch(ctx.Context(), query, page, perPage, orderBy)
}