Skip to content

Commit

Permalink
rename node-state to self-consensus-state
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed May 26, 2021
1 parent 4570955 commit c90b1e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (modules/light-clients/07-tendermint) [\#125](https://github.com/cosmos/ibc-go/pull/125) Implement efficient iteration of consensus states and pruning of earliest expired consensus state on UpdateClient.
* (modules/light-clients/07-tendermint) [\#141](https://github.com/cosmos/ibc-go/pull/141) Return early in case there's a duplicate update call to save Gas.

### Client Breaking Changes

* (02-client/cli) [\#196](https://github.com/cosmos/ibc-go/pull/196) Rename `node-state` cli command to `self-consensus-state`.

## IBC in the Cosmos SDK Repository

Expand Down
2 changes: 1 addition & 1 deletion modules/core/02-client/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func GetQueryCmd() *cobra.Command {
GetCmdQueryConsensusStates(),
GetCmdQueryConsensusState(),
GetCmdQueryHeader(),
GetCmdNodeConsensusState(),
GetCmdSelfConsensusState(),
GetCmdParams(),
)

Expand Down
15 changes: 7 additions & 8 deletions modules/core/02-client/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,20 @@ func GetCmdQueryHeader() *cobra.Command {
return cmd
}

// GetCmdNodeConsensusState defines the command to query the latest consensus state of a node
// The result is feed to client creation
func GetCmdNodeConsensusState() *cobra.Command {
// GetCmdSelfConsensusState defines the command to query the self consensus state of a chain
func GetCmdSelfConsensusState() *cobra.Command {
cmd := &cobra.Command{
Use: "node-state",
Short: "Query a node consensus state",
Long: "Query a node consensus state. This result is feed to the client creation transaction.",
Example: fmt.Sprintf("%s query %s %s node-state", version.AppName, host.ModuleName, types.SubModuleName),
Use: "self-consensus-state",
Short: "Query the self consensus state for this chain",
Long: "Query the self consensus state for this chain. This result may be used for verifying IBC clients representing this chain which are hosted on counterparty chains.",
Example: fmt.Sprintf("%s query %s %s self-consensus-state", version.AppName, host.ModuleName, types.SubModuleName),
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
state, _, err := utils.QueryNodeConsensusState(clientCtx)
state, _, err := utils.QuerySelfConsensusState(clientCtx)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions modules/core/02-client/client/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ func QueryTendermintHeader(clientCtx client.Context) (ibctmtypes.Header, int64,
return header, height, nil
}

// QueryNodeConsensusState takes a client context and returns the appropriate
// QuerySelfConsensusState takes a client context and returns the appropriate
// tendermint consensus state
func QueryNodeConsensusState(clientCtx client.Context) (*ibctmtypes.ConsensusState, int64, error) {
func QuerySelfConsensusState(clientCtx client.Context) (*ibctmtypes.ConsensusState, int64, error) {
node, err := clientCtx.GetNode()
if err != nil {
return &ibctmtypes.ConsensusState{}, 0, err
Expand Down

0 comments on commit c90b1e0

Please sign in to comment.