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

[Miner] feat: add events query client #64

Merged
merged 64 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3f2971b
feat: add the map channel observable operator
bryanchriswhite Oct 20, 2023
2baddb3
Merge remote-tracking branch 'pokt/main' into feat/observable-map
bryanchriswhite Oct 23, 2023
4af6643
feat: add replay observable
bryanchriswhite Oct 23, 2023
765b0c9
Merge branch 'feat/observable-map' into merge/map_x_replay
bryanchriswhite Oct 23, 2023
5f9ce1b
Merge branch 'feat/replay-observable' into merge/map_x_replay
bryanchriswhite Oct 23, 2023
9c42698
chore: add query client interface
bryanchriswhite Oct 14, 2023
6273f52
chore: add query client errors
bryanchriswhite Oct 19, 2023
30a0a28
test: fix false positive, prevent regression, & add comments
bryanchriswhite Oct 23, 2023
6a67cb2
chore: add godoc comment
bryanchriswhite Oct 23, 2023
ad0121d
feat: add query client implementation
bryanchriswhite Oct 14, 2023
ee42737
chore: add connection & dialer wrapper implementations
bryanchriswhite Oct 17, 2023
66fdc79
test: query client & add testquery helper pkg
bryanchriswhite Oct 14, 2023
891faf9
chore: add go_test_integration make target
bryanchriswhite Oct 14, 2023
c12afe6
chore: add internal mocks pkg
bryanchriswhite Oct 23, 2023
de4defe
test: query client integration test
bryanchriswhite Oct 23, 2023
0453b62
docs: add event query client docs
bryanchriswhite Oct 20, 2023
31099ec
chore: update go.mod
bryanchriswhite Oct 14, 2023
a28ad44
chore: re-order `eventsQueryClient` methods to improve readability
bryanchriswhite Oct 24, 2023
bab1465
chore: add godoc comments to testclient helpers
bryanchriswhite Oct 24, 2023
09d16b4
fix: comment formatting
bryanchriswhite Oct 24, 2023
1c2e38e
chore: improve comment & naming in evt query client test
bryanchriswhite Oct 24, 2023
b670aec
test: tune events query client parameters
bryanchriswhite Oct 24, 2023
01278b0
chore: improve godoc comments
bryanchriswhite Oct 24, 2023
f962995
chore: review improvements
bryanchriswhite Oct 24, 2023
72f2916
Merge remote-tracking branch 'pokt/main' into feat/observable-map
bryanchriswhite Oct 24, 2023
163bb45
refactor: `replayObservable` as its own interface type
bryanchriswhite Oct 24, 2023
82e361e
refactor: `replayObservable#Next() V` to `ReplayObservable#Last(ctx,…
bryanchriswhite Oct 24, 2023
299ffb1
chore: add constructor func for `ReplayObservable`
bryanchriswhite Oct 24, 2023
a52603f
test: reorder to improve readibility
bryanchriswhite Oct 24, 2023
65c9e6e
refactor: rename and add godoc comments
bryanchriswhite Oct 24, 2023
de9c0ee
Merge remote-tracking branch 'pokt/main' into feat/replay-observable
bryanchriswhite Oct 24, 2023
cb79b0a
Merge branch 'feat/replay-observable' into merge/map_x_replay
bryanchriswhite Oct 24, 2023
52c26e0
Merge branch 'feat/observable-map' into merge/map_x_replay
bryanchriswhite Oct 24, 2023
dfecf80
Merge branch 'merge/map_x_replay' into feat/query-client
bryanchriswhite Oct 24, 2023
507c79a
chore: improve naming & comments
bryanchriswhite Oct 24, 2023
bebe700
Merge branch 'feat/replay-observable' into merge/map_x_replay
bryanchriswhite Oct 24, 2023
8782c11
Merge branch 'merge/map_x_replay' into feat/query-client
bryanchriswhite Oct 24, 2023
31c0ceb
chore: add warning log and improve comments
bryanchriswhite Oct 25, 2023
f7a8df3
test: improve and add tests
bryanchriswhite Oct 25, 2023
2225e97
fix: interface assertion
bryanchriswhite Oct 25, 2023
84e21b7
fix: comment typo
bryanchriswhite Oct 25, 2023
7df6220
chore: review improvements
bryanchriswhite Oct 25, 2023
6f1cfcb
Merge remote-tracking branch 'pokt/main' into feat/replay-observable
bryanchriswhite Oct 25, 2023
00e0918
fix: race
bryanchriswhite Oct 25, 2023
9027c1e
fix: race on eventsBytesAndConns map
bryanchriswhite Oct 25, 2023
a19fcc0
fix: interface assertions
bryanchriswhite Oct 25, 2023
71344b3
Merge branch 'feat/replay-observable' into merge/map_x_replay
bryanchriswhite Oct 25, 2023
8978fa8
fix: race
bryanchriswhite Oct 25, 2023
9b90930
Merge branch 'merge/map_x_replay' into feat/query-client
bryanchriswhite Oct 25, 2023
a6d77b9
Merge remote-tracking branch 'pokt/feat/query-client' into feat/query…
bryanchriswhite Oct 25, 2023
4419602
Small updates to the README
Olshansk Oct 25, 2023
c093488
chore: review improvements
bryanchriswhite Oct 26, 2023
874d424
refactor: eliminate `EventsQueryClient#requestId` field
bryanchriswhite Oct 26, 2023
73dedf1
refactor: eliminate `EventsQueryClient#requestId` field
bryanchriswhite Oct 26, 2023
fab303f
refactor: move websocket dialer and connection to own pkg
bryanchriswhite Oct 26, 2023
fe681f9
chore: add comment
bryanchriswhite Oct 26, 2023
4830c06
chore: move `EventsBytesObservable type above interfaces
bryanchriswhite Oct 26, 2023
4762fa3
chore: review improvements
bryanchriswhite Oct 26, 2023
27ed494
fix: bug & improve naming & comments
bryanchriswhite Oct 26, 2023
676ff91
chore: review improvements
bryanchriswhite Oct 27, 2023
d7490ac
chore: review improvements
bryanchriswhite Oct 27, 2023
a094a9f
chore: add comment
bryanchriswhite Oct 27, 2023
9069667
Merge branch 'main' into feat/query-client
bryanchriswhite Oct 27, 2023
74ec7e8
revert: replay observable, merged into previous base branch
bryanchriswhite Oct 27, 2023
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
Prev Previous commit
Next Next commit
chore: add godoc comments to testclient helpers
bryanchriswhite committed Oct 24, 2023
commit bab14659f88cc639e3ffe59695de2b06cc06fa2a
2 changes: 2 additions & 0 deletions internal/testclient/testeventsquery/client.go
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ import (
eventsquery "pocket/pkg/client/events_query"
)

// NewLocalnetClient returns a new events query client which is configured to
// connect to the localnet sequencer.
func NewLocalnetClient(t *testing.T, opts ...client.EventsQueryClientOption) client.EventsQueryClient {
t.Helper()

12 changes: 10 additions & 2 deletions internal/testclient/testeventsquery/connection.go
Original file line number Diff line number Diff line change
@@ -9,6 +9,12 @@ import (
"pocket/internal/mocks/mockclient"
)

// OneTimeMockConnAndDialer returns a new mock connection and mock dialer that
// will return the mock connection when DialContext is called. The mock dialer
// will expect DialContext to be called exactly once. The connection mock will
// expect Close to be called exactly once.
// Callers must mock the Receive method with an EXPECT call before the connection
// mock can be used.
func OneTimeMockConnAndDialer(t *testing.T) (
*mockclient.MockConnection,
*mockclient.MockDialer,
@@ -24,15 +30,17 @@ func OneTimeMockConnAndDialer(t *testing.T) (
return connMock, dialerMock
}

// OneTimeMockDialer returns a mock dialer that will return either the given
// connection mock or error when DialContext is called. The mock dialer will
// expect DialContext to be called exactly once.
func OneTimeMockDialer(
t *testing.T,
eitherConnMock either.Either[*mockclient.MockConnection],
) *mockclient.MockDialer {
connMock, err := eitherConnMock.ValueOrError()

ctrl := gomock.NewController(t)
dialerMock := mockclient.NewMockDialer(ctrl)

connMock, err := eitherConnMock.ValueOrError()
dialerMock.EXPECT().DialContext(gomock.Any(), gomock.Any()).
Return(connMock, err).
Times(1)