mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-09 14:07:56 -05:00
Provide deposit info prior to chain-based info
This commit is contained in:
@@ -56,6 +56,19 @@ In quiet mode this will return 0 if the validator information can be obtained, o
|
||||
account, err := validatorInfoAccount()
|
||||
errCheck(err, "Failed to obtain validator account")
|
||||
|
||||
if verbose {
|
||||
network := network()
|
||||
outputIf(debug, fmt.Sprintf("Network is %s", network))
|
||||
pubKey, err := bestPublicKey(account)
|
||||
if err == nil {
|
||||
deposits, totalDeposited, err := graphData(network, pubKey.Marshal())
|
||||
if err == nil {
|
||||
fmt.Printf("Number of deposits: %d\n", deposits)
|
||||
fmt.Printf("Total deposited: %s\n", string2eth.GWeiToString(totalDeposited, true))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
validatorInfo, err := grpc.FetchValidatorInfo(eth2GRPCConn, account)
|
||||
errCheck(err, "Failed to obtain validator information")
|
||||
validator, err := grpc.FetchValidator(eth2GRPCConn, account)
|
||||
@@ -79,16 +92,6 @@ In quiet mode this will return 0 if the validator information can be obtained, o
|
||||
fmt.Printf("Status: %s\n", strings.Title(strings.ToLower(validatorInfo.Status.String())))
|
||||
fmt.Printf("Balance: %s\n", string2eth.GWeiToString(validatorInfo.Balance, true))
|
||||
|
||||
if verbose {
|
||||
network := network()
|
||||
outputIf(debug, fmt.Sprintf("Network is %s", network))
|
||||
deposits, totalDeposited, err := graphData(network, validator.PublicKey)
|
||||
if err == nil {
|
||||
fmt.Printf("Number of deposits: %d\n", deposits)
|
||||
fmt.Printf("Total deposited: %s\n", string2eth.GWeiToString(totalDeposited, true))
|
||||
}
|
||||
}
|
||||
|
||||
if validatorInfo.Status == ethpb.ValidatorStatus_ACTIVE ||
|
||||
validatorInfo.Status == ethpb.ValidatorStatus_EXITING ||
|
||||
validatorInfo.Status == ethpb.ValidatorStatus_SLASHING {
|
||||
|
||||
Reference in New Issue
Block a user