Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(x/authz): extend validate genesis #18042

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions x/authz/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ func NewGenesisState(entries []GrantAuthorization) *GenesisState {
}
}

// ValidateGenesis check the given genesis state has no integrity issues
func ValidateGenesis(data GenesisState) error {
return nil
}

// DefaultGenesisState - Return a default genesis state
func DefaultGenesisState() *GenesisState {
return &GenesisState{}
Expand Down
8 changes: 1 addition & 7 deletions x/authz/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/store"
"cosmossdk.io/depinject"
"cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/baseapp"
sdkclient "github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -78,12 +77,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {

// ValidateGenesis performs genesis state validation for the authz module.
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config sdkclient.TxEncodingConfig, bz json.RawMessage) error {
var data authz.GenesisState
if err := cdc.UnmarshalJSON(bz, &data); err != nil {
return errors.Wrapf(err, "failed to unmarshal %s genesis state", authz.ModuleName)
}

return authz.ValidateGenesis(data)
return nil
}

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the authz module.
Expand Down
Loading