From e94ebae6187f60e9e7da7b008c42bf524f209d4d Mon Sep 17 00:00:00 2001 From: Jeremy Wei Date: Wed, 27 Dec 2023 12:44:57 -0500 Subject: [PATCH] Revert "Add event data to result event (#165)" (#176) This reverts commit 72bb29caf821ed03900bcd74f4ddb439df85f5f1. --- internal/rpc/core/events.go | 2 +- rpc/client/local/local.go | 2 +- rpc/client/rpc_test.go | 6 ++---- rpc/coretypes/responses.go | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/rpc/core/events.go b/internal/rpc/core/events.go index 7dfcbd30c..621977c66 100644 --- a/internal/rpc/core/events.go +++ b/internal/rpc/core/events.go @@ -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) diff --git a/rpc/client/local/local.go b/rpc/client/local/local.go index 51a43eb39..0b2b5205a 100644 --- a/rpc/client/local/local.go +++ b/rpc/client/local/local.go @@ -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(): diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 29fbec3e6..2316b5f58 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/base64" - "fmt" "math" "net/http" @@ -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" @@ -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 } diff --git a/rpc/coretypes/responses.go b/rpc/coretypes/responses.go index 122a679ee..cce419b55 100644 --- a/rpc/coretypes/responses.go +++ b/rpc/coretypes/responses.go @@ -327,7 +327,7 @@ type ( type ResultEvent struct { SubscriptionID string Query string - Data types.EventData + Data types.LegacyEventData Events []abci.Event }