Skip to content
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

Update copies #134

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stader-cli/node/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ func registerNode(c *cli.Context, operatorName string) error {

operatorRewardAddressString := walletStatus.AccountAddress.String()

confirmText := "Would you wish to join the ETHx Socializing pool?\nType 'Y' to Opt-in or 'N' to Opt-out. \nNote: The Opt-In and Opt-Out of socializing pool will have a cool-off period of 56 days.\ni.e you will have to wait for 56 days to Opt-Out of the Socializing pool once you Opt-In and vice versa.\nLearn more about the ETHx Socializing Pool here:\nhttps://staderlabs.gitbook.io/ethereum/node-operator/permissionless-node-operator/ethx-rewards-for-permissionless-node-operators/socializing-pool\n"
confirmText := "Would you wish to join the ETHx Socializing pool?\nType 'Y' to Opt-in or 'N' to Opt-out. \nNote: The Opt-In and Opt-Out of socializing pool will have a cool-off period of 56 days.\ni.e you will have to wait for 56 days to Opt-Out of the Socializing pool once you Opt-In and vice versa.\nLearn more about the ETHx Socializing Pool here:\nhttps://www.staderlabs.com/docs-v1/Ethereum/Node-operator/permissionless-node-operator/ethx-rewards-for-permissionless-node-operators/socializing-pool\n"

socializeEl := cliutils.Confirm(confirmText)

// Check node can be registered
canRegister, err := staderClient.CanRegisterNode(operatorName, common.HexToAddress(operatorRewardAddressString), socializeEl)
if err != nil {
Expand Down
24 changes: 18 additions & 6 deletions stader-cli/node/update-socialize-el.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package node

import (
"fmt"

"github.com/stader-labs/stader-node/shared/services/gas"
"github.com/urfave/cli"

Expand Down Expand Up @@ -50,8 +51,19 @@ func UpdateSocializeEl(c *cli.Context, socializeEl bool) error {
return err
}

if !(c.Bool("yes") || cliutils.Confirm(fmt.Sprintf(
"Are you sure you want to update socializing pool participation?"))) {
var confirmText string

if socializeEl {
confirmText = `
Note: There is a 56-day cool-off period for both Opt-In and Opt-Out of the socializing pool. For example, once you Opt-In, you will have to wait for 56 days to Opt-Out of the Socializing pool, and vice versa.
Are you sure you want to Opt-Into the socializing pool? `
} else {
confirmText = `
Note: There is a 56-day cool-off period for both Opt-In and Opt-Out of the socializing pool. For example, once you Opt-Out, you will have to wait for 56 days to Opt Into the Socializing pool, and vice versa.
Are you sure you want to Opt-Out of the socializing pool?`
}

if !(c.Bool("yes") || cliutils.Confirm(confirmText)) {
fmt.Println("Cancelled.")
return nil
}
Expand All @@ -63,9 +75,9 @@ func UpdateSocializeEl(c *cli.Context, socializeEl bool) error {
}

if socializeEl {
fmt.Printf("Opting in for socializing pool...\n")
fmt.Printf("Opting into the socializing pool...\n")
} else {
fmt.Printf("Opting out for socializing pool...\n")
fmt.Printf("Opting out of the socializing pool...\n")
}
cliutils.PrintTransactionHash(staderClient, response.TxHash)
_, err = staderClient.WaitForTransaction(response.TxHash)
Expand All @@ -74,9 +86,9 @@ func UpdateSocializeEl(c *cli.Context, socializeEl bool) error {
}

if socializeEl {
fmt.Printf("Opted in of socializing pool...\n")
fmt.Printf("Your request to Opt-In to the socializing pool is successful and will take effect after 3 epochs, approximately 20 minutes. \n")
} else {
fmt.Printf("Opted out of socializing pool...\n")
fmt.Printf("Your request to Opt-Out of the socializing pool is successful and will take effect after 3 epochs, approximately 20 minutes. \n")
}

return nil
Expand Down