Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add event data to result event (#165)" #176

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/rpc/core/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (env *Environment) Subscribe(ctx context.Context, req *coretypes.RequestSub
// We have a message to deliver to the client.
resp := callInfo.RPCRequest.MakeResponse(&coretypes.ResultEvent{
Query: req.Query,
Data: msg.Data(),
Data: msg.LegacyData(),
Events: msg.Events(),
})
wctx, cancel := context.WithTimeout(opctx, 10*time.Second)
Expand Down
2 changes: 1 addition & 1 deletion rpc/client/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (c *Local) eventsRoutine(ctx context.Context, sub eventbus.Subscription, su
case outc <- coretypes.ResultEvent{
SubscriptionID: msg.SubscriptionID(),
Query: qstr,
Data: msg.Data(),
Data: msg.LegacyData(),
Events: msg.Events(),
}:
case <-ctx.Done():
Expand Down
6 changes: 2 additions & 4 deletions rpc/client/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"context"
"encoding/base64"

"fmt"
"math"
"net/http"
Expand All @@ -22,7 +21,6 @@ import (
"github.com/tendermint/tendermint/crypto/encoding"
"github.com/tendermint/tendermint/internal/mempool"
rpccore "github.com/tendermint/tendermint/internal/rpc/core"

tmjson "github.com/tendermint/tendermint/libs/json"
"github.com/tendermint/tendermint/libs/log"
tmmath "github.com/tendermint/tendermint/libs/math"
Expand Down Expand Up @@ -497,9 +495,9 @@ func TestClientMethodCalls(t *testing.T) {
for i := int64(0); i < 3; i++ {
event := <-eventCh

blockEvent, ok := event.Data.(types.EventDataNewBlock)
blockEvent, ok := event.Data.(types.LegacyEventDataNewBlock)
if !ok {
blockEventPtr, okPtr := event.Data.(*types.EventDataNewBlock)
blockEventPtr, okPtr := event.Data.(*types.LegacyEventDataNewBlock)
if okPtr {
blockEvent = *blockEventPtr
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/coretypes/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ type (
type ResultEvent struct {
SubscriptionID string
Query string
Data types.EventData
Data types.LegacyEventData
Events []abci.Event
}

Expand Down