rpc/client: add Events method to the client interface (#7982)

- Update documentation to deprecate the old methods.
- Add Events methods to HTTP, WS, and Local clients.
- Add Events method to the light client wrapper.
- Rename legacy events client to SubscriptionClient.
This commit is contained in:
M. J. Fromberger
2022-02-24 06:51:14 -08:00
committed by GitHub
parent 62a1cb8d17
commit 211b80a484
9 changed files with 81 additions and 29 deletions
+8 -5
View File
@@ -2,7 +2,6 @@ package proxy
import (
"context"
"errors"
"time"
"github.com/tendermint/tendermint/internal/eventlog/cursor"
@@ -30,15 +29,19 @@ func (p proxyService) GetConsensusState(ctx context.Context) (*coretypes.ResultC
return p.ConsensusState(ctx)
}
// TODO(creachadair): Remove this once the RPC clients support the new method.
// This is just a placeholder to let things build during development.
func (proxyService) Events(ctx context.Context,
func (p proxyService) Events(ctx context.Context,
filter *coretypes.EventFilter,
maxItems int,
before, after cursor.Cursor,
waitTime time.Duration,
) (*coretypes.ResultEvents, error) {
return nil, errors.New("the /events method is not implemented")
return p.Client.Events(ctx, &coretypes.RequestEvents{
Filter: filter,
MaxItems: maxItems,
Before: before.String(),
After: after.String(),
WaitTime: waitTime,
})
}
func (p proxyService) Subscribe(ctx context.Context, query string) (*coretypes.ResultSubscribe, error) {