Skip to content

Commit

Permalink
output claim when broadcast is not there
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Jul 4, 2024
1 parent 0e2e710 commit fc78a3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions pkg/common/print.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package common

import (
"fmt"
"reflect"
)

func PrettyPrintStruct(data interface{}) {
v := reflect.ValueOf(data)
typeOfS := v.Type()

for i := 0; i < v.NumField(); i++ {
fmt.Printf("%s: %v\n", typeOfS.Field(i).Name, v.Field(i).Interface())
}
}
10 changes: 5 additions & 5 deletions pkg/rewards/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error {
}

rootIndex := uint32(rootCount.Uint64() - 1)

fmt.Println(claimDate)

proofData, err := df.FetchClaimAmountsForDate(ctx, claimDate)
if err != nil {
return eigenSdkUtils.WrapError("failed to fetch claim amounts for date", err)
Expand Down Expand Up @@ -186,9 +185,10 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error {
return eigenSdkUtils.WrapError("failed to process claim", err)
}
} else {
// Write to file
//err = utils.WriteToFile(config.Output, solidityClaim)
fmt.Println(solidityClaim)
fmt.Println("------- Claim generated -------")
common.PrettyPrintStruct(*solidityClaim)
fmt.Println("-------------------------------")
fmt.Println("To broadcast the claim, use the --broadcast flag")
}

return nil
Expand Down

0 comments on commit fc78a3d

Please sign in to comment.