Skip to content

Commit 4c05ada

Browse files
committed
Struct naming conventions
Signed-off-by: Matthew Whitehead <[email protected]>
1 parent 1e8963d commit 4c05ada

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

internal/ethereum/event_enricher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (ee *eventEnricher) filterEnrichEthLog(ctx context.Context, f *eventFilter,
6363

6464
info := eventInfo{
6565
logJSONRPC: *ethLog,
66-
ChainId: ee.connector.chainID,
66+
ChainID: ee.connector.chainID,
6767
}
6868

6969
var timestamp *fftypes.FFTime

internal/ethereum/event_listener_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func TestListenerCatchupScalesBackOnExpectedError(t *testing.T) {
195195
l.catchupLoopDone = make(chan struct{})
196196
l.hwmBlock = 0
197197

198+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
198199
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBlockByHash", mock.MatchedBy(func(bh string) bool {
199200
return bh == "0x6b012339fbb85b70c58ecfd97b31950c4a28bcef5226e12dbe551cb1abaf3b4c"
200201
}), false).Return(nil).Run(func(args mock.Arguments) {
@@ -222,6 +223,7 @@ func TestListenerCatchupScalesBackNTimesOnExpectedError(t *testing.T) {
222223
l.catchupLoopDone = make(chan struct{})
223224
l.hwmBlock = 0
224225

226+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
225227
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBlockByHash", mock.MatchedBy(func(bh string) bool {
226228
return bh == "0x6b012339fbb85b70c58ecfd97b31950c4a28bcef5226e12dbe551cb1abaf3b4c"
227229
}), false).Return(nil).Run(func(args mock.Arguments) {
@@ -249,6 +251,7 @@ func TestListenerCatchupScalesBackToOne(t *testing.T) {
249251
l.catchupLoopDone = make(chan struct{})
250252
l.hwmBlock = 0
251253

254+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
252255
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBlockByHash", mock.MatchedBy(func(bh string) bool {
253256
return bh == "0x6b012339fbb85b70c58ecfd97b31950c4a28bcef5226e12dbe551cb1abaf3b4c"
254257
}), false).Return(nil).Run(func(args mock.Arguments) {
@@ -276,6 +279,7 @@ func TestListenerNoCatchupScaleBackOnErrorMismatch(t *testing.T) {
276279
l.catchupLoopDone = make(chan struct{})
277280
l.hwmBlock = 0
278281

282+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
279283
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBlockByHash", mock.MatchedBy(func(bh string) bool {
280284
return bh == "0x6b012339fbb85b70c58ecfd97b31950c4a28bcef5226e12dbe551cb1abaf3b4c"
281285
}), false).Return(nil).Run(func(args mock.Arguments) {
@@ -307,6 +311,7 @@ func TestListenerCatchupScalesBackCustomRegex(t *testing.T) {
307311

308312
assert.NoError(t, err)
309313

314+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
310315
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBlockByHash", mock.MatchedBy(func(bh string) bool {
311316
return bh == "0x6b012339fbb85b70c58ecfd97b31950c4a28bcef5226e12dbe551cb1abaf3b4c"
312317
}), false).Return(nil).Run(func(args mock.Arguments) {
@@ -345,6 +350,8 @@ func TestListenerCatchupNoScaleBackEmptyRegex(t *testing.T) {
345350
Number: ethtypes.NewHexInteger64(1001),
346351
}
347352
})
353+
354+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
348355
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(&rpcbackend.RPCError{Message: "ACME JSON/RPC endpoint error - eth_getLogs response size is too large"}).Times(5)
349356
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getLogs", mock.Anything).Return(nil).Run(func(args mock.Arguments) {
350357
*args[1].(*[]*logJSONRPC) = []*logJSONRPC{sampleTransferLog()}

internal/ethereum/event_stream.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type eventInfo struct {
4848
InputMethod string `json:"inputMethod,omitempty"` // the method invoked, if it matched one of the signatures in the listener definition
4949
InputArgs *fftypes.JSONAny `json:"inputArgs,omitempty"` // the method parameters, if the method matched one of the signatures in the listener definition
5050
InputSigner *ethtypes.Address0xHex `json:"inputSigner,omitempty"` // the signing `from` address of the transaction
51-
ChainId string `json:"chainId,omitempty"` // an identifier for the chain this event relates to
51+
ChainID string `json:"chainId,omitempty"` // an identifier for the chain this event relates to
5252
}
5353

5454
// eventStream is the state we hold in memory for each eventStream

0 commit comments

Comments
 (0)