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 block client #65

Merged
merged 97 commits into from
Nov 1, 2023
Merged
Changes from 1 commit
Commits
Show all changes
97 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
a963e24
chore: add block client interface
bryanchriswhite Oct 14, 2023
74ebb62
chore: add `MapReplay` operator
bryanchriswhite Oct 24, 2023
44b84ae
feat: add block client
bryanchriswhite Oct 14, 2023
b817851
test: block client integration
bryanchriswhite Oct 14, 2023
9955dbb
test: block client
bryanchriswhite Oct 23, 2023
acc69ef
docs: fix install instructions
bryanchriswhite Oct 25, 2023
9027c1e
fix: race on eventsBytesAndConns map
bryanchriswhite Oct 25, 2023
a19fcc0
fix: interface assertions
bryanchriswhite Oct 25, 2023
92a9db6
Merge branch 'feat/replay-observable' into feat/block-client
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
a123a13
Merge branch 'feat/query-client' into feat/block-client
bryanchriswhite Oct 25, 2023
4419602
Small updates to the README
Olshansk Oct 25, 2023
6d06bf7
refactor: add observableInternals interface
bryanchriswhite Oct 26, 2023
deed860
chore: update last; only block for 1 value min
bryanchriswhite Oct 26, 2023
7f81ce0
chore: review improvements
bryanchriswhite Oct 26, 2023
fc6f161
Merge branch 'main' into feat/replay-observable
bryanchriswhite Oct 26, 2023
729bcd1
Merge branch 'feat/replay-observable' into feat/block-client
bryanchriswhite Oct 26, 2023
4b2d922
refactor: move add `channelObservableInternals` & migrate its relevan…
bryanchriswhite Oct 26, 2023
614bc01
refactor: simplify, cleanup, & improve comments
bryanchriswhite Oct 26, 2023
c093488
chore: review improvements
bryanchriswhite Oct 26, 2023
874d424
refactor: eliminate `EventsQueryClient#requestId` field
bryanchriswhite Oct 26, 2023
0737a4a
Merge branch 'feat/query-client' into feat/block-client
bryanchriswhite Oct 26, 2023
777e340
refactor: review improvements
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
b0181dd
fix: notify `retryOnError()` of async error propagating through `#Eve…
bryanchriswhite Oct 26, 2023
ec3d475
chore: review improvements
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
1a4169d
Merge branch 'feat/query-client' into feat/block-client
bryanchriswhite Oct 26, 2023
f08fb04
chore: review improvements
bryanchriswhite Oct 27, 2023
f835b13
Merge remote-tracking branch 'pokt/main' into feat/replay-observable
bryanchriswhite Oct 27, 2023
f8ba998
Merge branch 'feat/replay-observable' into feat/block-client
bryanchriswhite Oct 27, 2023
00a025b
fix: bug in `accumulateReplayValues()`
bryanchriswhite Oct 27, 2023
3d0dd0a
Merge branch 'feat/replay-observable' into feat/block-client
bryanchriswhite Oct 27, 2023
b407e16
Merge remote-tracking branch 'pokt/main' into feat/block-client
bryanchriswhite Oct 27, 2023
e04177f
Merge remote-tracking branch 'pokt/main' into feat/replay-observable
bryanchriswhite Oct 27, 2023
27b805e
Merge branch 'feat/replay-observable' into feat/block-client
bryanchriswhite Oct 27, 2023
6c3c2b9
refactor: promote `retryOnError` to its own pkg: `retry.OnError`
bryanchriswhite Oct 30, 2023
6b005de
Merge remote-tracking branch 'pokt/main' into feat/block-client
bryanchriswhite Oct 30, 2023
b226a10
chore: improve comments
bryanchriswhite Oct 30, 2023
7ade4a0
test: inline wip test helpers
bryanchriswhite Oct 30, 2023
7cfe788
test: skip retry.OnError tests & comment
bryanchriswhite Oct 30, 2023
486dba0
chore: review feedback improvements
bryanchriswhite Oct 31, 2023
1677e3f
chore: review feedback improvements
bryanchriswhite Oct 31, 2023
cc466b2
Merge branch 'main' into feat/block-client
bryanchriswhite Oct 31, 2023
2f49089
Merge branch 'main' into feat/block-client
bryanchriswhite Nov 1, 2023
7ae2650
fix: format placeholder error
bryanchriswhite Nov 1, 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
refactor: review improvements
  • Loading branch information
bryanchriswhite committed Oct 26, 2023
commit 777e340e2055906b5e6ca1091015d0ebb757ae4e
2 changes: 1 addition & 1 deletion internal/testclient/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package testclient

const CometWebsocketURL = "ws://localhost:36657/websocket"
const CometLocalWebsocketURL = "ws://localhost:36657/websocket"
2 changes: 1 addition & 1 deletion internal/testclient/testblock/client.go
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ func NewLocalnetClient(ctx context.Context, t *testing.T) client.BlockClient {
require.NotNil(t, queryClient)

deps := depinject.Supply(queryClient)
bClient, err := block.NewBlockClient(ctx, deps, testclient.CometWebsocketURL)
bClient, err := block.NewBlockClient(ctx, deps, testclient.CometLocalWebsocketURL)
require.NoError(t, err)
return bClient
}
11 changes: 3 additions & 8 deletions pkg/client/block/client_test.go
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ package block_test
import (
"context"
"encoding/json"
"fmt"
"testing"
"time"

@@ -19,11 +18,7 @@ import (
eventsquery "pocket/pkg/client/events_query"
)

const blockAssertionLoopTimeout = 100 * time.Millisecond

func main() {
fmt.Println("HELLOO!!!")
}
const blockAssertionLoopTimeout = 500 * time.Millisecond

func TestBlockClient(t *testing.T) {
var (
@@ -44,7 +39,7 @@ func TestBlockClient(t *testing.T) {
)

// Set up a mock connection and dialer which are expected to be used once.
connMock, dialerMock := testeventsquery.OneTimeMockConnAndDialer(t)
connMock, dialerMock := testeventsquery.NewOneTimeMockConnAndDialer(t)
connMock.EXPECT().Send(gomock.Any()).Return(nil).Times(1)
// Mock the Receive method to return the expected block event.
connMock.EXPECT().Receive().DoAndReturn(func() ([]byte, error) {
@@ -59,7 +54,7 @@ func TestBlockClient(t *testing.T) {
deps := depinject.Supply(eventsQueryClient)

// Set up block client.
blockClient, err := block.NewBlockClient(ctx, deps, testclient.CometWebsocketURL)
blockClient, err := block.NewBlockClient(ctx, deps, testclient.CometLocalWebsocketURL)
require.NoError(t, err)
require.NotNil(t, blockClient)