Skip to content

Commit

Permalink
handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary committed Dec 20, 2024
1 parent c9978c3 commit 0ffd919
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/rewards/stakerOperators/3_rewardsForAllStrategyPayouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ func (sog *StakerOperatorsGenerator) GenerateAndInsert3RewardsForAllStrategyPayo
rewardsTables, err := sog.FindRewardsTableNamesForSearchPattersn(map[string]string{
rewardsUtils.Table_1_ActiveRewards: rewardsUtils.GoldTableNameSearchPattern[rewardsUtils.Table_1_ActiveRewards],
}, cutoffDate)
if err != nil {
sog.logger.Sugar().Errorw("Failed to find staker operator table names", "error", err)
return err
}

query, err := rewardsUtils.RenderQueryTemplate(_3_rewardsForAllStrategyPayoutsQuery, map[string]string{
"destTableName": destTableName,
Expand Down
5 changes: 5 additions & 0 deletions pkg/rewards/stakerOperators/4_rfaeStakerStrategyPayouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func (sog *StakerOperatorsGenerator) GenerateAndInsert4RfaeStakerStrategyPayout(
rewardsUtils.Table_1_ActiveRewards: rewardsUtils.GoldTableNameSearchPattern[rewardsUtils.Table_1_ActiveRewards],
rewardsUtils.Table_5_RfaeStakers: rewardsUtils.GoldTableNameSearchPattern[rewardsUtils.Table_5_RfaeStakers],
}, cutoffDate)
if err != nil {
sog.logger.Sugar().Errorw("Failed to find staker operator table names", "error", err)
return err
}

query, err := rewardsUtils.RenderQueryTemplate(_4_rfaeStakerStrategyPayoutsQuery, map[string]string{
"destTableName": destTableName,
"activeRewardsTable": rewardsTables[rewardsUtils.Table_1_ActiveRewards],
Expand Down
5 changes: 5 additions & 0 deletions pkg/rewards/stakerOperators/5_rfaeOperatorStrategyPayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ func (sog *StakerOperatorsGenerator) GenerateAndInsert5RfaeOperatorStrategyPayou
rewardsUtils.Table_1_ActiveRewards: rewardsUtils.GoldTableNameSearchPattern[rewardsUtils.Table_1_ActiveRewards],
rewardsUtils.Table_6_RfaeOperators: rewardsUtils.GoldTableNameSearchPattern[rewardsUtils.Table_6_RfaeOperators],
}, cutoffDate)
if err != nil {
sog.logger.Sugar().Errorw("Failed to find staker operator table names", "error", err)
return err
}

query, err := rewardsUtils.RenderQueryTemplate(_5_rfaeOperatorStrategyPayoutsQuery, map[string]string{
"destTableName": destTableName,
"activeRewardsTable": rewardsTables[rewardsUtils.Table_1_ActiveRewards],
Expand Down

0 comments on commit 0ffd919

Please sign in to comment.