diff --git a/pkg/rewards/operatorAvsRegistrationWindows_test.go b/pkg/rewards/operatorAvsRegistrationWindows_test.go index 28b72450..5e39bf78 100644 --- a/pkg/rewards/operatorAvsRegistrationWindows_test.go +++ b/pkg/rewards/operatorAvsRegistrationWindows_test.go @@ -48,8 +48,6 @@ func hydrateOperatorAvsStateChangesTable(grm *gorm.DB, l *zap.Logger) (int, erro return 0, err } - fmt.Printf("contents: %v", len(contents)) - _, err = sqlite.WrapTxAndCommit[interface{}](func(tx *gorm.DB) (interface{}, error) { for i, content := range contents { res := grm.Exec(content) @@ -69,8 +67,6 @@ func hydrateBlocksTable(grm *gorm.DB, l *zap.Logger) (int, error) { return 0, err } - fmt.Printf("contents: %v", len(contents)) - _, err = sqlite.WrapTxAndCommit[interface{}](func(tx *gorm.DB) (interface{}, error) { for i, content := range contents { res := grm.Exec(content) @@ -125,10 +121,7 @@ func Test_OperatorAvsRegistrationWindows(t *testing.T) { expectedResults, err := tests.GetExpectedOperatorAvsRegistrationWindows() assert.Nil(t, err) - fmt.Printf("Window: %+v\n", windows[0]) - fmt.Printf("windows: %v\n", len(windows)) - - // assert.Equal(t, len(expectedResults), len(windows)) + assert.Equal(t, len(expectedResults), len(windows)) // Sort expected slices.SortFunc(expectedResults, func(i, j *tests.ExpectedOperatorAvsRegistrationWindows) int { @@ -146,6 +139,8 @@ func Test_OperatorAvsRegistrationWindows(t *testing.T) { lacksExpectedResult := make([]*OperatorAvsRegistrationWindow, 0) + // Go line-by-line in the window results and find the corresponding line in the expected results. + // If one doesnt exist, add it to the missing list. for _, window := range windows { match := utils.Find(expectedResults, func(expected *tests.ExpectedOperatorAvsRegistrationWindows) bool { if expected.Operator == window.Operator && expected.Avs == window.Avs && expected.StartDate == window.StartTime && expected.EndDate == window.EndTime { @@ -158,11 +153,12 @@ func Test_OperatorAvsRegistrationWindows(t *testing.T) { lacksExpectedResult = append(lacksExpectedResult, window) } } - fmt.Printf("Errors: %+v\n", len(lacksExpectedResult)) - fmt.Printf("Expected: %+v\n", expectedResults[0]) + assert.Equal(t, 0, len(lacksExpectedResult)) - for i, window := range lacksExpectedResult { - fmt.Printf("%d - Window: %+v\n", i, window) + if len(lacksExpectedResult) > 0 { + for i, window := range lacksExpectedResult { + fmt.Printf("%d - Window: %+v\n", i, window) + } } })