-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
C:rpcComponent: JSON RPC, gRPCComponent: JSON RPC, gRPCT:bugType Bug (Confirmed)Type Bug (Confirmed)
Milestone
Description
Tendermint version: 0.22.8
The following patch adds a test that fails:
--- a/state/txindex/kv/kv_test.go
+++ b/state/txindex/kv/kv_test.go
@@ -89,6 +89,8 @@ func TestTxSearch(t *testing.T) {
{"account.owner CONTAINS 'an'", 1},
// search using CONTAINS
{"account.owner CONTAINS 'Vlad'", 0},
+ // search for the wrong key using CONTAINS
+ {"account.number CONTAINS 'Iv'", 0},
}
for _, tc := range testCases {
This happens because match() in state/txindex/kv/kv.go performs a full scan and tests the value, but neglects to test the key.
The best way to fix is to do a prefix lookup on key/ instead of a full scan. It should also work faster.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C:rpcComponent: JSON RPC, gRPCComponent: JSON RPC, gRPCT:bugType Bug (Confirmed)Type Bug (Confirmed)