Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Sep 27, 2024
1 parent 500b8dc commit 7e477db
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/rewards/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ const (
All ClaimType = "all"
Unclaimed ClaimType = "unclaimed"
Claimed ClaimType = "claimed"

AllRewards = "All Rewards"
UnclaimedRewards = "Unclaimed Rewards"
ClaimedRewards = "Claimed Rewards"
)

func ShowCmd(p utils.Prompter) *cli.Command {
Expand Down Expand Up @@ -129,7 +125,7 @@ func ShowRewards(cCtx *cli.Context) error {
}

allRewards := make(map[gethcommon.Address]*big.Int)
msg := AllRewards
msg := "All Rewards"
for pair := tokenAddressesMap.Oldest(); pair != nil; pair = pair.Next() {
amt, _ := new(big.Int).SetString(pair.Value.String(), 10)
allRewards[pair.Key] = amt
Expand All @@ -143,10 +139,10 @@ func ShowRewards(cCtx *cli.Context) error {
switch config.ClaimType {
case Claimed:
allRewards = claimedRewards
msg = ClaimedRewards
msg = "Claimed Rewards"
case Unclaimed:
allRewards = calculateUnclaimedRewards(allRewards, claimedRewards)
msg = UnclaimedRewards
msg = "Unclaimed Rewards"
}
}
err = handleRewardsOutput(config.Output, config.OutputType, allRewards, msg)
Expand Down

0 comments on commit 7e477db

Please sign in to comment.