Skip to content

Commit

Permalink
fix: fix vet err
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed May 27, 2024
1 parent 7017abe commit fbeb05c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
12 changes: 6 additions & 6 deletions node/pkg/fetcher/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ func TestAppRun(t *testing.T) {

for _, fetcher := range app.Fetchers {
for _, feed := range fetcher.Feeds {
result, err := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID)))
if err != nil {
t.Fatalf("error getting latest feed data: %v", err)
result, letestFeedDataErr := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID)))
if letestFeedDataErr != nil {
t.Fatalf("error getting latest feed data: %v", letestFeedDataErr)
}
assert.NotNil(t, result)
}
rdbResult, err := db.Get(ctx, "localAggregate:"+strconv.Itoa(int(fetcher.Config.ID)))
if err != nil {
t.Fatalf("error getting local aggregate: %v", err)
rdbResult, localAggregateErr := db.Get(ctx, "localAggregate:"+strconv.Itoa(int(fetcher.Config.ID)))
if localAggregateErr != nil {
t.Fatalf("error getting local aggregate: %v", localAggregateErr)
}
assert.NotNil(t, rdbResult)
}
Expand Down
12 changes: 6 additions & 6 deletions node/pkg/fetcher/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ func TestFetcherFetcherJob(t *testing.T) {
}

for _, fetcher := range app.Fetchers {
err := fetcher.fetcherJob(ctx, app.ChainHelpers, app.Proxies)
if err != nil {
t.Fatalf("error fetching: %v", err)
jobErr := fetcher.fetcherJob(ctx, app.ChainHelpers, app.Proxies)
if jobErr != nil {
t.Fatalf("error fetching: %v", jobErr)
}
}
defer db.Del(ctx, "feedDataBuffer")

for _, fetcher := range app.Fetchers {
for _, feed := range fetcher.Feeds {
res, err := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID)))
if err != nil {
t.Fatalf("error fetching feed data: %v", err)
res, latestFeedDataErr := db.GetObject[FeedData](ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID)))
if latestFeedDataErr != nil {
t.Fatalf("error fetching feed data: %v", latestFeedDataErr)
}
assert.NotNil(t, res)
defer db.Del(ctx, "latestFeedData:"+strconv.Itoa(int(feed.ID)))
Expand Down
7 changes: 3 additions & 4 deletions node/pkg/fetcher/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ func TestInsertLocalAggregatePgsql(t *testing.T) {

configs := testItems.insertedConfigs
for i, config := range configs {

err := insertLocalAggregatePgsql(ctx, config.Id, float64(i)+5)
if err != nil {
t.Fatalf("error inserting local aggregate pgsql: %v", err)
insertLocalAggregateErr := insertLocalAggregatePgsql(ctx, config.Id, float64(i)+5)
if insertLocalAggregateErr != nil {
t.Fatalf("error inserting local aggregate pgsql: %v", insertLocalAggregateErr)
}
}

Expand Down

0 comments on commit fbeb05c

Please sign in to comment.