Skip to content

Commit 75cd62e

Browse files
committed
Remove deploy megapool as it is done automatically on first deposit
1 parent b8bc5c1 commit 75cd62e

6 files changed

Lines changed: 0 additions & 229 deletions

File tree

bindings/node/node.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -706,28 +706,6 @@ func ConfirmRPLWithdrawalAddress(rp *rocketpool.RocketPool, nodeAddress common.A
706706
return tx.Hash(), nil
707707
}
708708

709-
func EstimateDeployMegapool(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (rocketpool.GasInfo, error) {
710-
rocketNodeManager, err := getRocketNodeManager(rp, nil)
711-
if err != nil {
712-
return rocketpool.GasInfo{}, err
713-
}
714-
return rocketNodeManager.GetTransactionGasInfo(opts, "deployMegapool")
715-
}
716-
717-
// Deploys a Megapool contract
718-
func DeployMegapool(rp *rocketpool.RocketPool, opts *bind.TransactOpts) (common.Hash, error) {
719-
rocketNodeManager, err := getRocketNodeManager(rp, nil)
720-
if err != nil {
721-
return common.Hash{}, nil
722-
}
723-
724-
tx, err := rocketNodeManager.Transact(opts, "deployMegapool")
725-
if err != nil {
726-
return common.Hash{}, fmt.Errorf("error calling deployMegapool: %w", err)
727-
}
728-
return tx.Hash(), nil
729-
}
730-
731709
// Get express ticket count for a node
732710
func GetExpressTicketCount(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error) {
733711
rocketMegapoolFactory, err := getRocketNodeManager(rp, opts)

rocketpool-cli/megapool/commands.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
1313
Aliases: aliases,
1414
Usage: "Manage the node's megapool",
1515
Subcommands: []cli.Command{
16-
{
17-
Name: "deploy",
18-
Usage: "Deploy a megapool contract for your node",
19-
UsageText: "rocketpool node deploy",
20-
Flags: []cli.Flag{
21-
cli.BoolFlag{
22-
Name: "yes, y",
23-
Usage: "Automatically confirm deployment",
24-
},
25-
},
26-
Action: func(c *cli.Context) error {
27-
return deployMegapool(c)
28-
},
29-
},
3016
{
3117
Name: "deposit",
3218
Aliases: []string{"d"},

rocketpool/api/megapool/commands.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,6 @@ func RegisterSubcommands(command *cli.Command, name string, aliases []string) {
1414
Aliases: aliases,
1515
Usage: "Manage the node's megapool",
1616
Subcommands: []cli.Command{
17-
{
18-
Name: "can-deploy-megapool",
19-
Usage: "Check if the node can deploy a megapool",
20-
UsageText: "rocketpool api node can-deploy-megapool",
21-
Action: func(c *cli.Context) error {
22-
23-
// Validate args
24-
if err := cliutils.ValidateArgCount(c, 0); err != nil {
25-
return err
26-
}
27-
28-
// Run
29-
api.PrintResponse(canDeployMegapool(c))
30-
return nil
31-
32-
},
33-
},
34-
35-
{
36-
Name: "deploy-megapool",
37-
Usage: "Deploy the node's megapool",
38-
UsageText: "rocketpool api node deploy-megapool",
39-
Action: func(c *cli.Context) error {
40-
41-
// Validate args
42-
if err := cliutils.ValidateArgCount(c, 0); err != nil {
43-
return err
44-
}
45-
46-
// Run
47-
api.PrintResponse(deployMegapool(c))
48-
return nil
49-
50-
},
51-
},
5217
{
5318
Name: "can-distribute-megapool",
5419
Usage: "Check if can distribute megapool rewards",

rocketpool/api/megapool/deploy-megapool.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

shared/services/rocketpool/node.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,38 +1241,6 @@ func (c *Client) SendMessage(address common.Address, message []byte) (api.NodeSe
12411241
return response, nil
12421242
}
12431243

1244-
// Check if the node can deploy a megapool
1245-
func (c *Client) CanDeployMegapool() (api.CanDeployMegapoolResponse, error) {
1246-
responseBytes, err := c.callAPI("megapool can-deploy-megapool")
1247-
if err != nil {
1248-
return api.CanDeployMegapoolResponse{}, fmt.Errorf("Could not get can-deploy-megapool response: %w", err)
1249-
}
1250-
var response api.CanDeployMegapoolResponse
1251-
if err := json.Unmarshal(responseBytes, &response); err != nil {
1252-
return api.CanDeployMegapoolResponse{}, fmt.Errorf("Could not decode can-deploy-megapool response: %w", err)
1253-
}
1254-
if response.Error != "" {
1255-
return api.CanDeployMegapoolResponse{}, fmt.Errorf("Could not get can-deploy-megapool response: %s", response.Error)
1256-
}
1257-
return response, nil
1258-
}
1259-
1260-
// Deploy a megapool
1261-
func (c *Client) DeployMegapool() (api.DeployMegapoolResponse, error) {
1262-
responseBytes, err := c.callAPI("megapool deploy-megapool")
1263-
if err != nil {
1264-
return api.DeployMegapoolResponse{}, fmt.Errorf("Could not get deploy-megapool response: %w", err)
1265-
}
1266-
var response api.DeployMegapoolResponse
1267-
if err := json.Unmarshal(responseBytes, &response); err != nil {
1268-
return api.DeployMegapoolResponse{}, fmt.Errorf("Could not decode deploy-megapool response: %w", err)
1269-
}
1270-
if response.Error != "" {
1271-
return api.DeployMegapoolResponse{}, fmt.Errorf("Could not get deploy-megapool response: %s", response.Error)
1272-
}
1273-
return response, nil
1274-
}
1275-
12761244
// Get the number of express tickets available for the node
12771245
func (c *Client) GetExpressTicketCount() (api.GetExpressTicketCountResponse, error) {
12781246
responseBytes, err := c.callAPI("node get-express-ticket-count")

shared/types/api/node.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -762,20 +762,6 @@ type NodeAlertsResponse struct {
762762
// TODO: change to GettableAlerts
763763
Message string `json:"message"`
764764
}
765-
type CanDeployMegapoolResponse struct {
766-
Status string `json:"status"`
767-
Error string `json:"error"`
768-
CanDeploy bool `json:"canDeploy"`
769-
AlreadyDeployed bool `json:"alreadyDeployed"`
770-
ExpectedAddress common.Address `json:"expectedAddress"`
771-
GasInfo rocketpool.GasInfo `json:"gasInfo"`
772-
}
773-
774-
type DeployMegapoolResponse struct {
775-
Status string `json:"status"`
776-
Error string `json:"error"`
777-
TxHash common.Hash `json:"txHash"`
778-
}
779765

780766
type GetExpressTicketCountResponse struct {
781767
Status string `json:"status"`

0 commit comments

Comments
 (0)