Skip to content

Commit

Permalink
Updating Libs (#8147)
Browse files Browse the repository at this point in the history
* BLS
* Sqlite
  • Loading branch information
Giulio2002 authored Sep 6, 2023
1 parent 86cec41 commit 22bd173
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cl/persistence/beacon_indicies/sql_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon/cl/cltypes"
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
)

type SQLObject interface {
Expand Down
2 changes: 1 addition & 1 deletion cl/persistence/beacon_indicies/sql_indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func setupTestDB(t *testing.T) *sql.DB {
// Create an in-memory SQLite DB for testing purposes
db, err := sql.Open("sqlite3", "file::memory:?cache=shared")
db, err := sql.Open("sqlite", "file::memory:?cache=shared")
require.NoError(t, err)
return db
}
Expand Down
2 changes: 1 addition & 1 deletion cl/persistence/block_saver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func getTestBlock() *cltypes.SignedBeaconBlock {

func setupStore(t *testing.T, full bool) (BeaconChainDatabase, *sql.DB, execution_client.ExecutionEngine) {
// Open an in-memory SQLite database for testing
db, err := sql.Open("sqlite3", ":memory:")
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cl/persistence/db_config/db_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"testing"

"github.com/ledgerwatch/erigon/cl/persistence/sql_migrations"
_ "github.com/mattn/go-sqlite3"
"github.com/stretchr/testify/require"
_ "modernc.org/sqlite"
)

func setupTestDB(t *testing.T) *sql.DB {
db, err := sql.Open("sqlite3", ":memory:")
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cl/persistence/sql_migrations/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"database/sql"
"testing"

_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
)

func TestApplyMigrations(t *testing.T) {
// Open an in-memory SQLite database for testing
db, err := sql.Open("sqlite3", ":memory:")
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/capcli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (b *Blocks) Run(ctx *Context) error {
return err
}

sqlDB, err := sql.Open("sqlite3", "caplin/db")
sqlDB, err := sql.Open("sqlite", "caplin/db")
if err != nil {
return err
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func (b *Epochs) Run(cctx *Context) error {
if err != nil {
return err
}
sqlDB, err := sql.Open("sqlite3", "caplin/db")
sqlDB, err := sql.Open("sqlite", "caplin/db")
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/caplin-phase1/caplin1/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func RunCaplinPhase1(ctx context.Context, sentinel sentinel.SentinelClient,
dataDirIndexer := path.Join(dirs.DataDir, "beacon_indicies")

os.Remove(dataDirIndexer)
db, err := sql.Open("sqlite3", dataDirIndexer)
db, err := sql.Open("sqlite", dataDirIndexer)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
require (
gfx.cafe/util/go/generic v0.0.0-20230502013805-237fcc25d586
github.com/99designs/gqlgen v0.17.33
github.com/Giulio2002/bls v0.0.0-20230611172327-c0b9800e7b57
github.com/Giulio2002/bls v0.0.0-20230906201036-c2330c97dc7d
github.com/RoaringBitmap/roaring v1.2.3
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/VictoriaMetrics/metrics v1.23.1
Expand Down Expand Up @@ -58,7 +58,6 @@ require (
github.com/libp2p/go-libp2p-pubsub v0.9.3
github.com/maticnetwork/crand v1.0.2
github.com/maticnetwork/polyproto v0.0.2
github.com/mattn/go-sqlite3 v1.14.16
github.com/multiformats/go-multiaddr v0.9.0
github.com/nxadm/tail v1.4.9-0.20211216163028-4472660a31a6
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ github.com/99designs/gqlgen v0.17.33 h1:VTUpAtElDszatPSe26N0SD0deJCSxb7TZLlUb6Jn
github.com/99designs/gqlgen v0.17.33/go.mod h1:ygDK+m8zGpoQuSh8xoq80UfisR5JTZr7mN57qXlSIZs=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Giulio2002/bls v0.0.0-20230611172327-c0b9800e7b57 h1:583GFQgWYOAz3dKqHqARVY3KkgebRcJtU4tzy+87gzc=
github.com/Giulio2002/bls v0.0.0-20230611172327-c0b9800e7b57/go.mod h1:vwm1rY/WKYdwv5Ii5US2bZ3MQVcHadnev+1Ml2QYWFk=
github.com/Giulio2002/bls v0.0.0-20230906201036-c2330c97dc7d h1:fAztVLpjcVcd2al4GL8xYr9Yp7LmXXSTuLqu83U8hKo=
github.com/Giulio2002/bls v0.0.0-20230906201036-c2330c97dc7d/go.mod h1:nCQrFU6/QsJtLS+SBLWRn9UG2nds1f3hQKfWHCrtUqw=
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI=
github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=
Expand Down Expand Up @@ -551,7 +551,6 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
Expand Down

0 comments on commit 22bd173

Please sign in to comment.