make the rest of the code compile

This commit is contained in:
Callum Waters
2021-08-24 13:26:01 +02:00
parent dcf91478f8
commit 68c54f0676
283 changed files with 3874 additions and 3906 deletions
+1 -1
View File
@@ -6,10 +6,10 @@ import (
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/pubsub"
"github.com/tendermint/tendermint/libs/pubsub/query"
"github.com/tendermint/tendermint/pkg/abci"
)
func TestExample(t *testing.T) {
+6 -6
View File
@@ -39,10 +39,10 @@ import (
"errors"
"fmt"
"github.com/tendermint/tendermint/abci/types"
tmsync "github.com/tendermint/tendermint/internal/libs/sync"
"github.com/tendermint/tendermint/libs/pubsub/query"
"github.com/tendermint/tendermint/libs/service"
"github.com/tendermint/tendermint/pkg/abci"
)
type operation int
@@ -71,7 +71,7 @@ var (
// allows event types to repeat themselves with the same set of keys and
// different values.
type Query interface {
Matches(events []types.Event) (bool, error)
Matches(events []abci.Event) (bool, error)
String() string
}
@@ -103,7 +103,7 @@ type cmd struct {
// publish
msg interface{}
events []types.Event
events []abci.Event
}
// Server allows clients to subscribe/unsubscribe for messages, publishing
@@ -315,13 +315,13 @@ func (s *Server) NumClientSubscriptions(clientID string) int {
// Publish publishes the given message. An error will be returned to the caller
// if the context is canceled.
func (s *Server) Publish(ctx context.Context, msg interface{}) error {
return s.PublishWithEvents(ctx, msg, []types.Event{})
return s.PublishWithEvents(ctx, msg, []abci.Event{})
}
// PublishWithEvents publishes the given message with the set of events. The set
// is matched with clients queries. If there is a match, the message is sent to
// the client.
func (s *Server) PublishWithEvents(ctx context.Context, msg interface{}, events []types.Event) error {
func (s *Server) PublishWithEvents(ctx context.Context, msg interface{}, events []abci.Event) error {
select {
case s.cmds <- cmd{op: pub, msg: msg, events: events}:
return nil
@@ -474,7 +474,7 @@ func (state *state) removeAll(reason error) {
}
}
func (state *state) send(msg interface{}, events []types.Event) error {
func (state *state) send(msg interface{}, events []abci.Event) error {
for qStr, clientSubscriptions := range state.subscriptions {
if sub, ok := clientSubscriptions[qStr]; ok && sub.id == qStr {
continue
+1 -1
View File
@@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/pkg/abci"
"github.com/tendermint/tendermint/libs/pubsub"
"github.com/tendermint/tendermint/libs/pubsub/query"
+2 -4
View File
@@ -1,15 +1,13 @@
package query
import (
"github.com/tendermint/tendermint/abci/types"
)
import "github.com/tendermint/tendermint/pkg/abci"
// Empty query matches any set of events.
type Empty struct {
}
// Matches always returns true.
func (Empty) Matches(events []types.Event) (bool, error) {
func (Empty) Matches(events []abci.Event) (bool, error) {
return true, nil
}
+1 -1
View File
@@ -4,8 +4,8 @@ import (
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/pubsub/query"
"github.com/tendermint/tendermint/pkg/abci"
)
func TestEmptyQueryMatchesAnything(t *testing.T) {
+3 -3
View File
@@ -16,7 +16,7 @@ import (
"strings"
"time"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/pkg/abci"
)
var (
@@ -200,7 +200,7 @@ func (q *Query) Conditions() ([]Condition, error) {
//
// For example, query "name=John" matches events = {"name": ["John", "Eric"]}.
// More examples could be found in parser_test.go and query_test.go.
func (q *Query) Matches(rawEvents []types.Event) (bool, error) {
func (q *Query) Matches(rawEvents []abci.Event) (bool, error) {
if len(rawEvents) == 0 {
return false, nil
}
@@ -505,7 +505,7 @@ func matchValue(value string, op Operator, operand reflect.Value) (bool, error)
return false, nil
}
func flattenEvents(events []types.Event) map[string][]string {
func flattenEvents(events []abci.Event) map[string][]string {
flattened := make(map[string][]string)
for _, event := range events {
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"time"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/pubsub/query"
"github.com/tendermint/tendermint/pkg/abci"
)
func expandEvents(flattenedEvents map[string][]string) []abci.Event {
+4 -4
View File
@@ -5,8 +5,8 @@ import (
"fmt"
"github.com/google/uuid"
"github.com/tendermint/tendermint/abci/types"
tmsync "github.com/tendermint/tendermint/internal/libs/sync"
"github.com/tendermint/tendermint/pkg/abci"
)
var (
@@ -90,10 +90,10 @@ func (s *Subscription) cancel(err error) {
type Message struct {
subID string
data interface{}
events []types.Event
events []abci.Event
}
func NewMessage(subID string, data interface{}, events []types.Event) Message {
func NewMessage(subID string, data interface{}, events []abci.Event) Message {
return Message{
subID: subID,
data: data,
@@ -109,4 +109,4 @@ func (msg Message) SubscriptionID() string { return msg.subID }
func (msg Message) Data() interface{} { return msg.data }
// Events returns events, which matched the client's query.
func (msg Message) Events() []types.Event { return msg.events }
func (msg Message) Events() []abci.Event { return msg.events }