Skip to content

Commit

Permalink
fix: Correct typo in error variable name in Unmarshal function
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Sep 13, 2024
1 parent 463a24d commit 85bc973
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/proto/xatu/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestEventFilter_FilterByEventNamesAndModules(t *testing.T) {
assert.False(t, shouldBeDropped)

// Test with a different source
testEvent.Meta.Client.ModuleName = xatu.ModuleName_MIMICRY
testEvent.Meta.Client.ModuleName = xatu.ModuleName_EL_MIMICRY

shouldBeDropped, err = filter.ShouldBeDropped(testEvent)
if err != nil {
Expand All @@ -199,7 +199,7 @@ func TestEventFilter_FilterByEventNamesAndModules(t *testing.T) {
assert.True(t, shouldBeDropped)

// Test with a different event name
testEvent.Meta.Client.ModuleName = xatu.ModuleName_MIMICRY
testEvent.Meta.Client.ModuleName = xatu.ModuleName_EL_MIMICRY

testEvent.Event.Name = xatu.Event_BEACON_API_ETH_V1_EVENTS_HEAD

Expand Down
5 changes: 3 additions & 2 deletions pkg/relaymonitor/ethereum/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ func (b *BeaconNetwork) fetchGenesisTime(ctx context.Context) (uint64, error) {

var data struct {
Data struct {
//nolint:tagliatelle // At the mercy of the config spec.
GenesisTime string `json:"genesis_time"`
} `json:"data"`
}

if err := json.Unmarshal(body, &data); err != nil {
return 0, fmt.Errorf("failed to unmarshal response body: %w", err)
if errr := json.Unmarshal(body, &data); errr != nil {
return 0, fmt.Errorf("failed to unmarshal response body: %w", errr)
}

if data.Data.GenesisTime == "" {
Expand Down

0 comments on commit 85bc973

Please sign in to comment.