Skip to content

Commit cd89f05

Browse files
committed
Struct naming conventions
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
1 parent 1e8963d commit cd89f05

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

internal/ethereum/blocklistener_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,7 @@ func TestBlockListenerReorgReplaceWholeCanonicalChain(t *testing.T) {
11771177
block1002HashB := ethtypes.MustNewHexBytes0xPrefix(fftypes.NewRandB32().String())
11781178
block1003HashB := ethtypes.MustNewHexBytes0xPrefix(fftypes.NewRandB32().String())
11791179

1180+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
11801181
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_blockNumber").Return(nil).Run(func(args mock.Arguments) {
11811182
hbh := args[1].(*ethtypes.HexInteger)
11821183
*hbh = *ethtypes.NewHexInteger64(1000)
@@ -1288,6 +1289,7 @@ func TestBlockListenerClosed(t *testing.T) {
12881289
block1002Hash := ethtypes.MustNewHexBytes0xPrefix(fftypes.NewRandB32().String())
12891290
block1003Hash := ethtypes.MustNewHexBytes0xPrefix(fftypes.NewRandB32().String())
12901291

1292+
mRPC.On("CallRPC", mock.Anything, mock.Anything, "net_version", mock.Anything).Return(&rpcbackend.RPCError{Message: "12345"}).Once()
12911293
mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_blockNumber").Return(nil).Run(func(args mock.Arguments) {
12921294
hbh := args[1].(*ethtypes.HexInteger)
12931295
*hbh = *ethtypes.NewHexInteger64(1000)

internal/ethereum/event_enricher.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 0 deletions
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) {

internal/ethereum/event_stream.go

Lines changed: 1 addition & 1 deletion
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)