-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deduplicate client ready checks, fix a few places they were missing #378
Conversation
@@ -18,7 +18,7 @@ const ( | |||
func generateRewardsTree(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was missing the ready check
@@ -14,7 +14,7 @@ import ( | |||
func initializeFeeDistributor(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was missing here as well
@@ -73,7 +73,7 @@ func initializeFeeDistributor(c *cli.Context) error { | |||
func distribute(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was missing here as well
@@ -14,7 +14,7 @@ import ( | |||
func sendMessage(c *cli.Context, toAddressOrENS string, message []byte) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was missing here as well
@@ -24,7 +24,7 @@ type PersonalSignature struct { | |||
func signMessage(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't need synced clients :)
@@ -13,7 +13,7 @@ import ( | |||
func initWallet(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't care about client status
@@ -12,7 +12,7 @@ import ( | |||
func purge(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't care about client status
rocketpool-cli/wallet/recover.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in recover/test-recovery, we only care about client status when -k isn't passed, so we record the result in ready
and check it
@@ -12,7 +12,7 @@ import ( | |||
func getStatus(c *cli.Context) error { | |||
|
|||
// Get RP client | |||
rp, err := rocketpool.NewClientFromCtx(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't care about client status
// When printing sync percents, we should avoid printing 100%. | ||
// This function is only called if we're still syncing, | ||
// and the `%0.2f` token will round up if we're above 99.99%. | ||
func SyncRatioToPercent(in float64) float64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might make sense to move this to a different util file, but for now i shoved it here
Good addition, this is definitely a better way to do it. Thanks Patches! |
No description provided.