diff --git a/pkg/contractStore/postgresContractStore/postgresContractStore_test.go b/pkg/contractStore/postgresContractStore/postgresContractStore_test.go index d811cf79..b32b625a 100644 --- a/pkg/contractStore/postgresContractStore/postgresContractStore_test.go +++ b/pkg/contractStore/postgresContractStore/postgresContractStore_test.go @@ -28,7 +28,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/avsOperators/avsOperators_test.go b/pkg/eigenState/avsOperators/avsOperators_test.go index 3015bb86..33580b53 100644 --- a/pkg/eigenState/avsOperators/avsOperators_test.go +++ b/pkg/eigenState/avsOperators/avsOperators_test.go @@ -33,7 +33,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/disabledDistributionRoots/disabledDistributionRoots_test.go b/pkg/eigenState/disabledDistributionRoots/disabledDistributionRoots_test.go index 14bb4009..cf2f1b1e 100644 --- a/pkg/eigenState/disabledDistributionRoots/disabledDistributionRoots_test.go +++ b/pkg/eigenState/disabledDistributionRoots/disabledDistributionRoots_test.go @@ -32,7 +32,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/eigenstate_test.go b/pkg/eigenState/eigenstate_test.go index 56166c5f..df2d5ca6 100644 --- a/pkg/eigenState/eigenstate_test.go +++ b/pkg/eigenState/eigenstate_test.go @@ -30,7 +30,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/operatorShares/operatorShares_test.go b/pkg/eigenState/operatorShares/operatorShares_test.go index 93eaf96f..74a68606 100644 --- a/pkg/eigenState/operatorShares/operatorShares_test.go +++ b/pkg/eigenState/operatorShares/operatorShares_test.go @@ -33,7 +33,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/rewardSubmissions/rewardSubmissions_test.go b/pkg/eigenState/rewardSubmissions/rewardSubmissions_test.go index 4bc94d6a..09a6816b 100644 --- a/pkg/eigenState/rewardSubmissions/rewardSubmissions_test.go +++ b/pkg/eigenState/rewardSubmissions/rewardSubmissions_test.go @@ -33,7 +33,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/stakerDelegations/stakerDelegations_test.go b/pkg/eigenState/stakerDelegations/stakerDelegations_test.go index 2049eef3..1a6a8caf 100644 --- a/pkg/eigenState/stakerDelegations/stakerDelegations_test.go +++ b/pkg/eigenState/stakerDelegations/stakerDelegations_test.go @@ -31,7 +31,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/stakerShares/stakerShares_test.go b/pkg/eigenState/stakerShares/stakerShares_test.go index 11474a40..be73b55b 100644 --- a/pkg/eigenState/stakerShares/stakerShares_test.go +++ b/pkg/eigenState/stakerShares/stakerShares_test.go @@ -32,7 +32,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/stateManager/stateManager_test.go b/pkg/eigenState/stateManager/stateManager_test.go index e8006d27..7564cd32 100644 --- a/pkg/eigenState/stateManager/stateManager_test.go +++ b/pkg/eigenState/stateManager/stateManager_test.go @@ -30,7 +30,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/eigenState/submittedDistributionRoots/submittedDistributionRoots_test.go b/pkg/eigenState/submittedDistributionRoots/submittedDistributionRoots_test.go index cd799506..ed4e82cf 100644 --- a/pkg/eigenState/submittedDistributionRoots/submittedDistributionRoots_test.go +++ b/pkg/eigenState/submittedDistributionRoots/submittedDistributionRoots_test.go @@ -32,7 +32,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/indexer/restakedStrategies_test.go b/pkg/indexer/restakedStrategies_test.go index 52520d84..cac54faf 100644 --- a/pkg/indexer/restakedStrategies_test.go +++ b/pkg/indexer/restakedStrategies_test.go @@ -41,7 +41,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/pipeline/pipelineIntegration_test.go b/pkg/pipeline/pipelineIntegration_test.go index 133d165f..2f16c389 100644 --- a/pkg/pipeline/pipelineIntegration_test.go +++ b/pkg/pipeline/pipelineIntegration_test.go @@ -74,7 +74,7 @@ func setup(ethConfig *ethereum.EthereumClientConfig) ( ethConfig.BaseUrl = rpcUrl client := ethereum.NewClient(ethConfig, l) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { log.Fatal(err) } diff --git a/pkg/postgres/postgres.go b/pkg/postgres/postgres.go index 23022471..b947dc87 100644 --- a/pkg/postgres/postgres.go +++ b/pkg/postgres/postgres.go @@ -29,13 +29,13 @@ type Postgres struct { Db *sql.DB } -func GetTestPostgresDatabaseWithMigrations(cfg config.DatabaseConfig, gCfg *config.Config, l *zap.Logger) ( +func GetTestPostgresDatabase(cfg config.DatabaseConfig, gCfg *config.Config, l *zap.Logger) ( string, *sql.DB, *gorm.DB, error, ) { - testDbName, pg, grm, err := GetTestPostgresDatabase(cfg, l) + testDbName, pg, grm, err := GetTestPostgresDatabaseWithoutMigrations(cfg, l) if err != nil { return testDbName, nil, nil, err } @@ -48,7 +48,7 @@ func GetTestPostgresDatabaseWithMigrations(cfg config.DatabaseConfig, gCfg *conf return testDbName, pg, grm, nil } -func GetTestPostgresDatabase(cfg config.DatabaseConfig, l *zap.Logger) ( +func GetTestPostgresDatabaseWithoutMigrations(cfg config.DatabaseConfig, l *zap.Logger) ( string, *sql.DB, *gorm.DB, diff --git a/pkg/rewards/combinedRewards_test.go b/pkg/rewards/combinedRewards_test.go index 06e075a1..f29c2024 100644 --- a/pkg/rewards/combinedRewards_test.go +++ b/pkg/rewards/combinedRewards_test.go @@ -25,7 +25,7 @@ func setupCombinedRewards() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/operatorAvsRegistrationSnaphots_test.go b/pkg/rewards/operatorAvsRegistrationSnaphots_test.go index 9080fbe9..1baa4bf8 100644 --- a/pkg/rewards/operatorAvsRegistrationSnaphots_test.go +++ b/pkg/rewards/operatorAvsRegistrationSnaphots_test.go @@ -40,7 +40,7 @@ func setupOperatorAvsRegistrationSnapshot() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/operatorAvsStrategySnapshots_test.go b/pkg/rewards/operatorAvsStrategySnapshots_test.go index 14a40ac1..d990e632 100644 --- a/pkg/rewards/operatorAvsStrategySnapshots_test.go +++ b/pkg/rewards/operatorAvsStrategySnapshots_test.go @@ -41,7 +41,7 @@ func setupOperatorAvsStrategyWindows() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/operatorShareSnapshots_test.go b/pkg/rewards/operatorShareSnapshots_test.go index 728fc4d1..4c276d8a 100644 --- a/pkg/rewards/operatorShareSnapshots_test.go +++ b/pkg/rewards/operatorShareSnapshots_test.go @@ -39,7 +39,7 @@ func setupOperatorShareSnapshot() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/operatorShares_test.go b/pkg/rewards/operatorShares_test.go index d2f5726c..c5c10252 100644 --- a/pkg/rewards/operatorShares_test.go +++ b/pkg/rewards/operatorShares_test.go @@ -38,7 +38,7 @@ func setupOperatorShares() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/rewards_test.go b/pkg/rewards/rewards_test.go index 4e42c9b4..44d09838 100644 --- a/pkg/rewards/rewards_test.go +++ b/pkg/rewards/rewards_test.go @@ -107,7 +107,7 @@ func setupRewards() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/stakerDelegationSnapshots_test.go b/pkg/rewards/stakerDelegationSnapshots_test.go index 062f4362..e97805cb 100644 --- a/pkg/rewards/stakerDelegationSnapshots_test.go +++ b/pkg/rewards/stakerDelegationSnapshots_test.go @@ -40,7 +40,7 @@ func setupStakerDelegationSnapshot() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/stakerShareSnapshots_test.go b/pkg/rewards/stakerShareSnapshots_test.go index a62487f8..84683365 100644 --- a/pkg/rewards/stakerShareSnapshots_test.go +++ b/pkg/rewards/stakerShareSnapshots_test.go @@ -39,7 +39,7 @@ func setupStakerShareSnapshot() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/rewards/stakerShares_test.go b/pkg/rewards/stakerShares_test.go index f638e90d..08939b8e 100644 --- a/pkg/rewards/stakerShares_test.go +++ b/pkg/rewards/stakerShares_test.go @@ -38,7 +38,7 @@ func setupStakerShares() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err } diff --git a/pkg/snapshot/snapshot_test.go b/pkg/snapshot/snapshot_test.go index a4d18dfc..75da18aa 100644 --- a/pkg/snapshot/snapshot_test.go +++ b/pkg/snapshot/snapshot_test.go @@ -158,7 +158,7 @@ func TestCreateAndRestoreSnapshot(t *testing.T) { } t.Run("Create snapshot from a database with migrations", func(t *testing.T) { - dbName, _, dbGrm, dbErr := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbName, _, dbGrm, dbErr := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if dbErr != nil { t.Fatal(dbErr) } @@ -188,7 +188,7 @@ func TestCreateAndRestoreSnapshot(t *testing.T) { }) t.Run("Restore snapshot to a new database", func(t *testing.T) { - dbName, _, dbGrm, dbErr := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, l) + dbName, _, dbGrm, dbErr := postgres.GetTestPostgresDatabaseWithoutMigrations(cfg.DatabaseConfig, l) if dbErr != nil { t.Fatal(dbErr) } diff --git a/pkg/storage/postgres/storage_test.go b/pkg/storage/postgres/storage_test.go index 425e7b64..3c0c21a9 100644 --- a/pkg/storage/postgres/storage_test.go +++ b/pkg/storage/postgres/storage_test.go @@ -32,7 +32,7 @@ func setup() ( l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) - dbname, _, grm, err := postgres.GetTestPostgresDatabaseWithMigrations(cfg.DatabaseConfig, cfg, l) + dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { return dbname, nil, nil, nil, err }