Skip to content

Commit

Permalink
Merge branch 'master' into rmdbsql
Browse files Browse the repository at this point in the history
  • Loading branch information
millken authored Sep 25, 2022
2 parents ab67dbe + 7fcba5c commit 6ed65a4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ioctl/cmd/node/nodedelegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func delegates() error {
if err != nil {
return output.NewError(0, "failed to get epoch meta", err)
}
if response.EpochData == nil {
return output.NewError(0, "ROLLDPOS is not registered", nil)
}
epochData := response.EpochData
aliases := alias.GetAliasMap()
message := delegatesMessage{
Expand Down
3 changes: 3 additions & 0 deletions ioctl/cmd/node/nodeprobationlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func probationlist() error {
if err != nil {
return output.NewError(0, "failed to get epoch meta", err)
}
if response.EpochData == nil {
return output.NewError(0, "ROLLDPOS is not registered", nil)
}
probationlist, err := getProbationList(_epochNum, response.EpochData.Height)
if err != nil {
return output.NewError(0, "failed to get probation list", err)
Expand Down
1 change: 1 addition & 0 deletions ioctl/newcmd/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func NewNodeCmd(client ioctl.Client) *cobra.Command {
}
nc.AddCommand(NewNodeDelegateCmd(client))
nc.AddCommand(NewNodeRewardCmd(client))
nc.AddCommand(NewNodeProbationlistCmd(client))

client.SetEndpointWithFlag(nc.PersistentFlags().StringVar)
client.SetInsecureWithFlag(nc.PersistentFlags().BoolVar)
Expand Down
3 changes: 3 additions & 0 deletions ioctl/newcmd/node/nodedelegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ func NewNodeDelegateCmd(client ioctl.Client) *cobra.Command {
if err != nil {
return errors.Wrap(err, "failed to get epoch meta")
}
if response.EpochData == nil {
return errors.New("ROLLDPOS is not registered")
}
epochData := response.EpochData
aliases := client.AliasMap()
message := delegatesMessage{
Expand Down
3 changes: 3 additions & 0 deletions ioctl/newcmd/node/nodeprobationlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func NewNodeProbationlistCmd(client ioctl.Client) *cobra.Command {
if err != nil {
return errors.Wrap(err, "failed to get epoch meta")
}
if response.EpochData == nil {
return errors.New("ROLLDPOS is not registered")
}
probationlist, err := getProbationList(client, epochNum, response.EpochData.Height)
if err != nil {
return errors.Wrap(err, "failed to get probation list")
Expand Down
4 changes: 4 additions & 0 deletions ioctl/newcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/iotexproject/iotex-core/ioctl"
"github.com/iotexproject/iotex-core/ioctl/config"
"github.com/iotexproject/iotex-core/ioctl/newcmd/account"
"github.com/iotexproject/iotex-core/ioctl/newcmd/bc"
"github.com/iotexproject/iotex-core/ioctl/newcmd/node"
)

// Multi-language support
Expand Down Expand Up @@ -47,6 +49,8 @@ func NewIoctl(client ioctl.Client) *cobra.Command {

rootCmd.AddCommand(config.ConfigCmd)
rootCmd.AddCommand(account.NewAccountCmd(client))
rootCmd.AddCommand(bc.NewBCCmd(client))
rootCmd.AddCommand(node.NewNodeCmd(client))

return rootCmd
}
Expand Down

0 comments on commit 6ed65a4

Please sign in to comment.