pubsub: use concrete queries instead of an interface (#7686)

Remove the pubsub.Query interface and instead use the concrete query type.
Nothing uses any other implementation but pubsub/query.

* query: remove the error from the Matches method
* Update all usage.
This commit is contained in:
M. J. Fromberger
2022-01-25 11:16:48 -08:00
committed by GitHub
parent f163acf499
commit 079c7af007
10 changed files with 39 additions and 79 deletions

View File

@@ -7,7 +7,6 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/internal/jsontypes"
tmpubsub "github.com/tendermint/tendermint/internal/pubsub"
tmquery "github.com/tendermint/tendermint/internal/pubsub/query"
)
@@ -266,11 +265,11 @@ var (
EventQueryStateSyncStatus = QueryForEvent(EventStateSyncStatusValue)
)
func EventQueryTxFor(tx Tx) tmpubsub.Query {
func EventQueryTxFor(tx Tx) *tmquery.Query {
return tmquery.MustCompile(fmt.Sprintf("%s='%s' AND %s='%X'", EventTypeKey, EventTxValue, TxHashKey, tx.Hash()))
}
func QueryForEvent(eventValue string) tmpubsub.Query {
func QueryForEvent(eventValue string) *tmquery.Query {
return tmquery.MustCompile(fmt.Sprintf("%s='%s'", EventTypeKey, eventValue))
}