refactor: x/consensus audit changes (#16695)
This commit is contained in:
parent
ab77fe20d3
commit
1c091aab0b
@ -28,7 +28,7 @@ const (
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type QueryClient interface {
|
||||
// Params queries the parameters of x/consensus_param module.
|
||||
// Params queries the parameters of x/consensus module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
||||
// All implementations must embed UnimplementedQueryServer
|
||||
// for forward compatibility
|
||||
type QueryServer interface {
|
||||
// Params queries the parameters of x/consensus_param module.
|
||||
// Params queries the parameters of x/consensus module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ const (
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type MsgClient interface {
|
||||
// UpdateParams defines a governance operation for updating the x/consensus_param module parameters.
|
||||
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
@ -56,7 +56,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
type MsgServer interface {
|
||||
// UpdateParams defines a governance operation for updating the x/consensus_param module parameters.
|
||||
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
|
||||
@ -9,7 +9,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types";
|
||||
|
||||
// Query defines the gRPC querier service.
|
||||
service Query {
|
||||
// Params queries the parameters of x/consensus_param module.
|
||||
// Params queries the parameters of x/consensus module.
|
||||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||
option (google.api.http).get = "/cosmos/consensus/v1/params";
|
||||
}
|
||||
|
||||
@ -9,11 +9,11 @@ import "tendermint/types/params.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types";
|
||||
|
||||
// Msg defines the bank Msg service.
|
||||
// Msg defines the consensus Msg service.
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// UpdateParams defines a governance operation for updating the x/consensus_param module parameters.
|
||||
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
|
||||
@ -35,20 +35,20 @@ var (
|
||||
_ module.AppModuleBasic = AppModuleBasic{}
|
||||
)
|
||||
|
||||
// AppModuleBasic defines the basic application module used by the consensus_param module.
|
||||
// AppModuleBasic defines the basic application module used by the consensus module.
|
||||
type AppModuleBasic struct {
|
||||
cdc codec.Codec
|
||||
}
|
||||
|
||||
// Name returns the consensus_param module's name.
|
||||
// Name returns the consensus module's name.
|
||||
func (AppModuleBasic) Name() string { return types.ModuleName }
|
||||
|
||||
// RegisterLegacyAminoCodec registers the consensus_param module's types on the LegacyAmino codec.
|
||||
// RegisterLegacyAminoCodec registers the consensus module's types on the LegacyAmino codec.
|
||||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
}
|
||||
|
||||
// DefaultGenesis returns default genesis state as raw bytes for the consensus_param
|
||||
// DefaultGenesis returns default genesis state as raw bytes for the consensus
|
||||
// module.
|
||||
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
|
||||
// nil is returned since default genesis of consensus params is handled by tendermint
|
||||
@ -115,10 +115,10 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
|
||||
}
|
||||
}
|
||||
|
||||
// Name returns the consensus_param module's name.
|
||||
// Name returns the consensus module's name.
|
||||
func (AppModule) Name() string { return types.ModuleName }
|
||||
|
||||
// InitGenesis is handled by for init genesis of consensus_param
|
||||
// InitGenesis is handled by for init genesis of consensus
|
||||
func (am AppModule) InitGenesis(sdk.Context, codec.JSONCodec, json.RawMessage) []abci.ValidatorUpdate {
|
||||
// nil is returned since initgenesis of consensus params is handled by tendermint
|
||||
return nil
|
||||
|
||||
@ -9,13 +9,6 @@ import (
|
||||
|
||||
var _ sdk.Msg = &MsgUpdateParams{}
|
||||
|
||||
// GetSigners returns the signer addresses that are expected to sign the result
|
||||
// of GetSignBytes.
|
||||
func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress {
|
||||
authority, _ := sdk.AccAddressFromBech32(msg.Authority)
|
||||
return []sdk.AccAddress{authority}
|
||||
}
|
||||
|
||||
func (msg MsgUpdateParams) ToProtoConsensusParams() cmtproto.ConsensusParams {
|
||||
return cmtproto.ConsensusParams{
|
||||
Block: &cmtproto.BlockParams{
|
||||
|
||||
@ -155,7 +155,7 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type QueryClient interface {
|
||||
// Params queries the parameters of x/consensus_param module.
|
||||
// Params queries the parameters of x/consensus module.
|
||||
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
type QueryServer interface {
|
||||
// Params queries the parameters of x/consensus_param module.
|
||||
// Params queries the parameters of x/consensus module.
|
||||
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||
}
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type MsgClient interface {
|
||||
// UpdateParams defines a governance operation for updating the x/consensus_param module parameters.
|
||||
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
@ -218,7 +218,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// UpdateParams defines a governance operation for updating the x/consensus_param module parameters.
|
||||
// UpdateParams defines a governance operation for updating the x/consensus module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
|
||||
Loading…
Reference in New Issue
Block a user