Skip to content

Commit

Permalink
test additions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xrajath committed Dec 4, 2024
1 parent 49d6bc7 commit 25b2119
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions pkg/rewards/rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package rewards
import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"time"

"github.com/Layr-Labs/sidecar/internal/config"
"github.com/Layr-Labs/sidecar/internal/logger"
"github.com/Layr-Labs/sidecar/internal/tests"
Expand All @@ -14,11 +20,6 @@ import (
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"gorm.io/gorm"
"os"
"path/filepath"
"strings"
"testing"
"time"
)

// const TOTAL_BLOCK_COUNT = 1229187
Expand Down Expand Up @@ -249,6 +250,38 @@ func Test_Rewards(t *testing.T) {
fmt.Printf("\tRows in gold_6_rfae_operators: %v - [time: %v]\n", rows, time.Since(testStart))
testStart = time.Now()

fmt.Printf("Running gold_7_active_od_rewards\n")
err = rc.Generate7ActiveODRewards(snapshotDate)
assert.Nil(t, err)
rows, err = getRowCountForTable(grm, goldTableNames[rewardsUtils.Table_7_ActiveODRewards])
assert.Nil(t, err)
fmt.Printf("\tRows in gold_7_active_od_rewards: %v - [time: %v]\n", rows, time.Since(testStart))
testStart = time.Now()

fmt.Printf("Running gold_8_operator_od_reward_amounts\n")
err = rc.GenerateGold8OperatorODRewardAmountsTable(snapshotDate)
assert.Nil(t, err)
rows, err = getRowCountForTable(grm, goldTableNames[rewardsUtils.Table_8_OperatorODRewardAmounts])
assert.Nil(t, err)
fmt.Printf("\tRows in gold_8_operator_od_reward_amounts: %v - [time: %v]\n", rows, time.Since(testStart))
testStart = time.Now()

fmt.Printf("Running gold_9_staker_od_reward_amounts\n")
err = rc.GenerateGold9StakerODRewardAmountsTable(snapshotDate)
assert.Nil(t, err)
rows, err = getRowCountForTable(grm, goldTableNames[rewardsUtils.Table_9_StakerODRewardAmounts])
assert.Nil(t, err)
fmt.Printf("\tRows in gold_9_staker_od_reward_amounts: %v - [time: %v]\n", rows, time.Since(testStart))
testStart = time.Now()

fmt.Printf("Running gold_10_avs_od_reward_amounts\n")
err = rc.GenerateGold10AvsODRewardAmountsTable(snapshotDate)
assert.Nil(t, err)
rows, err = getRowCountForTable(grm, goldTableNames[rewardsUtils.Table_10_AvsODRewardAmounts])
assert.Nil(t, err)
fmt.Printf("\tRows in gold_10_avs_od_reward_amounts: %v - [time: %v]\n", rows, time.Since(testStart))
testStart = time.Now()

fmt.Printf("Running gold_7_staging\n")
err = rc.GenerateGold7StagingTable(snapshotDate)
assert.Nil(t, err)
Expand Down

0 comments on commit 25b2119

Please sign in to comment.