Skip to content

Commit a3cfb31

Browse files
Merge pull request #172 from kaleido-io/streamid
Remove unnecessary streamID param to ethconnect
2 parents 54f1c43 + 8952c3c commit a3cfb31

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

internal/blockchain/ethereum/ethereum.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ type subscription struct {
7373
ID string `json:"id"`
7474
Description string `json:"description"`
7575
Name string `json:"name"`
76-
StreamID string `json:"streamID"`
7776
Stream string `json:"stream"`
7877
FromBlock string `json:"fromBlock"`
7978
}
@@ -192,7 +191,7 @@ func (e *Ethereum) ensureEventStreams(ethconnectConf config.Prefix) error {
192191

193192
log.L(e.ctx).Infof("Event stream: %s", e.initInfo.stream.ID)
194193

195-
return e.ensureSusbscriptions(e.initInfo.stream.ID)
194+
return e.ensureSubscriptions()
196195
}
197196

198197
func (e *Ethereum) afterConnect(ctx context.Context, w wsclient.WSClient) error {
@@ -211,7 +210,7 @@ func (e *Ethereum) afterConnect(ctx context.Context, w wsclient.WSClient) error
211210
return err
212211
}
213212

214-
func (e *Ethereum) ensureSusbscriptions(streamID string) error {
213+
func (e *Ethereum) ensureSubscriptions() error {
215214
for eventType, subDesc := range requiredSubscriptions {
216215

217216
var existingSubs []*subscription
@@ -231,7 +230,6 @@ func (e *Ethereum) ensureSusbscriptions(streamID string) error {
231230
newSub := subscription{
232231
Name: eventType,
233232
Description: subDesc,
234-
StreamID: streamID,
235233
Stream: e.initInfo.stream.ID,
236234
FromBlock: "0",
237235
}

internal/blockchain/ethereum/ethereum_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func TestInitAllNewStreamsAndWSEvent(t *testing.T) {
127127
func(req *http.Request) (*http.Response, error) {
128128
var body map[string]interface{}
129129
json.NewDecoder(req.Body).Decode(&body)
130-
assert.Equal(t, "es12345", body["streamID"])
130+
assert.Equal(t, "es12345", body["stream"])
131131
return httpmock.NewJsonResponderOrPanic(200, subscription{ID: "sub12345"})(req)
132132
})
133133

0 commit comments

Comments
 (0)