Skip to content

Commit

Permalink
Revert "Add event data to result event (#165)" (#176)
Browse files Browse the repository at this point in the history
This reverts commit 72bb29c.
  • Loading branch information
jewei1997 authored Dec 27, 2023
1 parent 016c1b9 commit e94ebae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
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

0 comments on commit e94ebae

Please sign in to comment.