From 1e62fa82ed55aa2ad8669b62ac251be86e27201f Mon Sep 17 00:00:00 2001 From: Sean McGary Date: Thu, 16 Jan 2025 08:47:58 -0600 Subject: [PATCH] fix: update a few things that were not caught as part of the rebase of master --- .../defaultOperatorSplits/defaultOperatorSplits_test.go | 4 +++- pkg/eigenState/operatorAVSSplits/operatorAVSSplits_test.go | 4 +++- .../operatorDirectedRewardSubmissions_test.go | 4 +++- pkg/eigenState/operatorPISplits/operatorPISplits_test.go | 4 +++- pkg/rewards/rewards.go | 4 ++-- pkg/snapshot/snapshot_test.go | 4 ++-- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pkg/eigenState/defaultOperatorSplits/defaultOperatorSplits_test.go b/pkg/eigenState/defaultOperatorSplits/defaultOperatorSplits_test.go index 4594e349..b0eb3d2e 100644 --- a/pkg/eigenState/defaultOperatorSplits/defaultOperatorSplits_test.go +++ b/pkg/eigenState/defaultOperatorSplits/defaultOperatorSplits_test.go @@ -3,6 +3,7 @@ package defaultOperatorSplits import ( "fmt" "math/big" + "os" "testing" "time" @@ -26,9 +27,10 @@ func setup() ( error, ) { cfg := config.NewConfig() + cfg.Debug = os.Getenv(config.Debug) == "true" cfg.DatabaseConfig = *tests.GetDbConfigFromEnv() - l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: true}) + l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { diff --git a/pkg/eigenState/operatorAVSSplits/operatorAVSSplits_test.go b/pkg/eigenState/operatorAVSSplits/operatorAVSSplits_test.go index 9e60db9d..93d4ef51 100644 --- a/pkg/eigenState/operatorAVSSplits/operatorAVSSplits_test.go +++ b/pkg/eigenState/operatorAVSSplits/operatorAVSSplits_test.go @@ -3,6 +3,7 @@ package operatorAVSSplits import ( "fmt" "math/big" + "os" "strings" "testing" "time" @@ -27,9 +28,10 @@ func setup() ( error, ) { cfg := config.NewConfig() + cfg.Debug = os.Getenv(config.Debug) == "true" cfg.DatabaseConfig = *tests.GetDbConfigFromEnv() - l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: true}) + l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { diff --git a/pkg/eigenState/operatorDirectedRewardSubmissions/operatorDirectedRewardSubmissions_test.go b/pkg/eigenState/operatorDirectedRewardSubmissions/operatorDirectedRewardSubmissions_test.go index e6693b2e..43e777ad 100644 --- a/pkg/eigenState/operatorDirectedRewardSubmissions/operatorDirectedRewardSubmissions_test.go +++ b/pkg/eigenState/operatorDirectedRewardSubmissions/operatorDirectedRewardSubmissions_test.go @@ -3,6 +3,7 @@ package operatorDirectedRewardSubmissions import ( "fmt" "math/big" + "os" "strings" "testing" "time" @@ -27,9 +28,10 @@ func setup() ( error, ) { cfg := config.NewConfig() + cfg.Debug = os.Getenv(config.Debug) == "true" cfg.DatabaseConfig = *tests.GetDbConfigFromEnv() - l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: true}) + l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { diff --git a/pkg/eigenState/operatorPISplits/operatorPISplits_test.go b/pkg/eigenState/operatorPISplits/operatorPISplits_test.go index 9bc12b07..4822bf43 100644 --- a/pkg/eigenState/operatorPISplits/operatorPISplits_test.go +++ b/pkg/eigenState/operatorPISplits/operatorPISplits_test.go @@ -3,6 +3,7 @@ package operatorPISplits import ( "fmt" "math/big" + "os" "strings" "testing" "time" @@ -27,9 +28,10 @@ func setup() ( error, ) { cfg := config.NewConfig() + cfg.Debug = os.Getenv(config.Debug) == "true" cfg.DatabaseConfig = *tests.GetDbConfigFromEnv() - l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: true}) + l, _ := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) dbname, _, grm, err := postgres.GetTestPostgresDatabase(cfg.DatabaseConfig, cfg, l) if err != nil { diff --git a/pkg/rewards/rewards.go b/pkg/rewards/rewards.go index 7c094e46..9caf183b 100644 --- a/pkg/rewards/rewards.go +++ b/pkg/rewards/rewards.go @@ -740,7 +740,7 @@ func (rc *RewardsCalculator) FindClaimableDistributionRoot(rootIndex int64) (*ty order by sdr.root_index desc limit 1 ` - renderedQuery, err := rewardsUtils.RenderQueryTemplate(query, map[string]string{ + renderedQuery, err := rewardsUtils.RenderQueryTemplate(query, map[string]interface{}{ "rootIndex": strconv.Itoa(int(rootIndex)), }) if err != nil { @@ -775,7 +775,7 @@ func (rc *RewardsCalculator) GetGeneratedRewardsForSnapshotDate(snapshotDate str and grs.snapshot_date::timestamp(6) >= '{{.snapshotDate}}'::timestamp(6) order by grs.snapshot_date asc limit 1 - `, map[string]string{"snapshotDate": snapshotDate}) + `, map[string]interface{}{"snapshotDate": snapshotDate}) if err != nil { rc.logger.Sugar().Errorw("Failed to render query template", "error", err) diff --git a/pkg/snapshot/snapshot_test.go b/pkg/snapshot/snapshot_test.go index 75da18aa..96098105 100644 --- a/pkg/snapshot/snapshot_test.go +++ b/pkg/snapshot/snapshot_test.go @@ -137,10 +137,10 @@ func TestSetupRestore(t *testing.T) { func setup() (*config.Config, *zap.Logger, error) { cfg := config.NewConfig() cfg.Chain = config.Chain_Mainnet - cfg.Debug = false + cfg.Debug = os.Getenv(config.Debug) == "true" cfg.DatabaseConfig = *tests.GetDbConfigFromEnv() - l, err := logger.NewLogger(&logger.LoggerConfig{Debug: true}) + l, err := logger.NewLogger(&logger.LoggerConfig{Debug: cfg.Debug}) if err != nil { return nil, nil, err }