Skip to content

Commit 8308de1

Browse files
committed
Add provision express tickets message to node status
1 parent cc35162 commit 8308de1

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

rocketpool-cli/node/status.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,14 @@ func getStatus(c *cli.Context) error {
125125
}
126126
} else {
127127
fmt.Println("The node does not have a megapool deployed yet.")
128-
fmt.Println()
129128
}
130-
fmt.Printf("The node has %d express ticket(s).", status.ExpressTicketCount)
129+
130+
if status.ExpressTicketsProvisioned {
131+
fmt.Printf("The node has %d express queue ticket(s).", status.ExpressTicketCount)
132+
} else {
133+
fmt.Printf("%sThe node has unprovisioned express queue ticket(s). Please provision them using the `rocketpool node provision-express-tickets` command. You are eligible for %d express tickets.%s", colorYellow, status.ExpressTicketCount, colorReset)
134+
}
135+
131136
fmt.Println()
132137
fmt.Println()
133138
}

rocketpool/api/node/status.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ func getStatus(c *cli.Context) (*api.NodeStatusResponse, error) {
135135
}
136136
return err
137137
})
138+
wg.Go(func() error {
139+
provisioned, err := node.GetExpressTicketsProvisioned(rp, nodeAccount.Address, nil)
140+
if err == nil {
141+
response.ExpressTicketsProvisioned = provisioned
142+
}
143+
return err
144+
})
138145

139146
}
140147

shared/types/api/node.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type NodeStatusResponse struct {
9292
MegapoolRefundValue *big.Int `json:"megapoolRefundValue"`
9393
IsSaturnDeployed bool `json:"isSaturnDeployed"`
9494
ExpressTicketCount uint64 `json:"expressTicketCount"`
95+
ExpressTicketsProvisioned bool `json:"expressTicketsProvisioned"`
9596
UnstakingRPL *big.Int `json:"unstakingRPL"`
9697
LastRPLUnstakeTime time.Time `json:"lastRPLUnstakeTime"`
9798
UnstakingPeriodDuration time.Duration `json:"unstakingPeriodDuration"`

0 commit comments

Comments
 (0)