5
5
"encoding/json"
6
6
"errors"
7
7
"fmt"
8
- "io"
9
8
"math/big"
10
9
"net/http"
11
10
"sort"
@@ -75,7 +74,6 @@ func getClaimFlags() []cli.Flag {
75
74
& ClaimTimestampFlag ,
76
75
& ProofStoreBaseURLFlag ,
77
76
& flags .VerboseFlag ,
78
- & SilentFlag ,
79
77
}
80
78
81
79
allFlags := append (baseFlags , flags .GetSignerFlags ()... )
@@ -87,10 +85,6 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error {
87
85
ctx := cCtx .Context
88
86
logger := common .GetLogger (cCtx )
89
87
90
- if cCtx .Bool (SilentFlag .Name ) {
91
- logger = logging .NewTextSLogger (io .Discard , nil )
92
- }
93
-
94
88
config , err := readAndValidateClaimConfig (cCtx , logger )
95
89
if err != nil {
96
90
return eigenSdkUtils .WrapError ("failed to read and validate claim config" , err )
@@ -246,24 +240,31 @@ func Claim(cCtx *cli.Context, p utils.Prompter) error {
246
240
logger .Infof ("Claim written to file: %s" , config .Output )
247
241
} else {
248
242
fmt .Println (string (jsonData ))
249
- logger .Info ("To write to a file, use the --output flag" )
243
+ fmt .Println ()
244
+ fmt .Println ("To write to a file, use the --output flag" )
250
245
}
251
246
} else {
252
247
if ! common .IsEmptyString (config .Output ) {
253
- logger .Info ("output file not supported for pretty output type" )
248
+ fmt .Println ("output file not supported for pretty output type" )
249
+ fmt .Println ()
254
250
}
255
251
solidityClaim := claimgen .FormatProofForSolidity (accounts .Root (), claim )
256
- logger .Info ("------- Claim generated -------" )
252
+ if ! config .IsSilent {
253
+ fmt .Println ("------- Claim generated -------" )
254
+ }
257
255
common .PrettyPrintStruct (* solidityClaim )
258
- logger .Info ("-------------------------------" )
259
- logger .Info ("To write to a file, use the --output flag" )
256
+ if ! config .IsSilent {
257
+ fmt .Println ("-------------------------------" )
258
+ fmt .Println ("To write to a file, use the --output flag" )
259
+ }
260
260
}
261
- if ! cCtx . Bool ( SilentFlag . Name ) {
261
+ if ! config . IsSilent {
262
262
txFeeDetails := common .GetTxFeeDetails (unsignedTx )
263
- logger . Info ( " \n " )
263
+ fmt . Println ( )
264
264
txFeeDetails .Print ()
265
+
266
+ fmt .Println ("To broadcast the claim, use the --broadcast flag" )
265
267
}
266
- logger .Info ("To broadcast the claim, use the --broadcast flag" )
267
268
}
268
269
269
270
return nil
@@ -372,6 +373,7 @@ func readAndValidateClaimConfig(cCtx *cli.Context, logger logging.Logger) (*Clai
372
373
splitTokenAddresses := strings .Split (tokenAddresses , "," )
373
374
validTokenAddresses := getValidHexAddresses (splitTokenAddresses )
374
375
rewardsCoordinatorAddress := cCtx .String (RewardsCoordinatorAddressFlag .Name )
376
+ isSilent := cCtx .Bool (SilentFlag .Name )
375
377
376
378
var err error
377
379
if common .IsEmptyString (rewardsCoordinatorAddress ) {
@@ -455,6 +457,7 @@ func readAndValidateClaimConfig(cCtx *cli.Context, logger logging.Logger) (*Clai
455
457
SignerConfig : signerConfig ,
456
458
ClaimTimestamp : claimTimestamp ,
457
459
ClaimerAddress : claimerAddress ,
460
+ IsSilent : isSilent ,
458
461
}, nil
459
462
}
460
463
0 commit comments