Skip to content

Commit

Permalink
fix: remove unused param
Browse files Browse the repository at this point in the history
  • Loading branch information
jazg committed Jun 25, 2021
1 parent 83d8333 commit ce6a571
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
15 changes: 1 addition & 14 deletions compat/v1/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package v1_test

import (
"context"
"database/sql"
"encoding/json"
"errors"
"fmt"
"math/rand"
"os"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -19,7 +17,6 @@ import (
"github.com/renproject/darknode/engine"
"github.com/renproject/darknode/tx"
v1 "github.com/renproject/lightnode/compat/v1"
"github.com/renproject/lightnode/db"
"github.com/renproject/lightnode/testutils"
"github.com/renproject/multichain"
"github.com/renproject/pack"
Expand All @@ -31,22 +28,12 @@ var _ = Describe("Compat V0", func() {
mr, err := miniredis.Run()
Expect(err).ToNot(HaveOccurred())

sqlDB, err := sql.Open("sqlite3", "./test.db")
database := db.New(sqlDB)
client := redis.NewClient(&redis.Options{
Addr: mr.Addr(),
})
return v1.NewCompatStore(database, client)
return v1.NewCompatStore(client)
}

BeforeSuite(func() {
os.Remove("./test.db")
})

AfterSuite(func() {
os.Remove("./test.db")
})

It("should convert a QueryBlockState response into a QueryState response", func() {
stateResponse, err := v1.QueryStateResponseFromState(testutils.MockBindings(logrus.New(), 0), testutils.MockEngineState())

Expand Down
5 changes: 1 addition & 4 deletions compat/v1/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/renproject/darknode/engine"
"github.com/renproject/darknode/tx"
"github.com/renproject/id"
"github.com/renproject/lightnode/db"
"github.com/renproject/pack"
)

Expand All @@ -18,13 +17,11 @@ type GpubkeyCompatStore interface {
}

type Store struct {
db db.DB
client redis.Cmdable
}

func NewCompatStore(db db.DB, client redis.Cmdable) *Store {
func NewCompatStore(client redis.Cmdable) *Store {
return &Store{
db: db,
client: client,
}
}
Expand Down
2 changes: 1 addition & 1 deletion lightnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func New(options Options, ctx context.Context, logger logrus.FieldLogger, sqlDB
cacher := cacher.New(dispatcher, logger, ttlCache, opts, db)

versionStore := v0.NewCompatStore(db, client)
gpubkeyStore := v1.NewCompatStore(db, client)
gpubkeyStore := v1.NewCompatStore(client)
hostChains := map[multichain.Chain]bool{}
for _, selector := range options.Whitelist {
if selector.IsLock() && selector.IsMint() {
Expand Down
2 changes: 1 addition & 1 deletion resolver/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var _ = Describe("Resolver", func() {
go cacher.Run(ctx)

versionStore := v0.NewCompatStore(database, client)
gpubkeyStore := v1.NewCompatStore(database, client)
gpubkeyStore := v1.NewCompatStore(client)

pubkeyB, err := base64.URLEncoding.DecodeString("AiF7_2ykZmts2wzZKJ5D-J1scRM2Pm2jJ84W_K4PQaGl")
Expect(err).ShouldNot(HaveOccurred())
Expand Down

0 comments on commit ce6a571

Please sign in to comment.