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(auth): decouple auth Keeper API from Msg and Query server implementation #15985

Merged
merged 6 commits into from
May 1, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
change collection name to just "Params"
  • Loading branch information
unknown unknown committed Apr 28, 2023
commit 6c8ea95060c4baef86ec2dd9dd06fffec1c7ade5
8 changes: 4 additions & 4 deletions x/auth/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type AccountKeeper struct {
authority string

// State
ParamsState collections.Item[types.Params] // NOTE: name is this because it conflicts with the Params gRPC method impl
Params collections.Item[types.Params]
AccountNumber collections.Sequence
}

Expand Down Expand Up @@ -107,7 +107,7 @@ func NewAccountKeeper(
cdc: cdc,
permAddrs: permAddrs,
authority: authority,
ParamsState: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
AccountNumber: collections.NewSequence(sb, types.GlobalAccountNumberKey, "account_number"),
}
}
Expand Down Expand Up @@ -265,12 +265,12 @@ func (ak AccountKeeper) getBech32Prefix() (string, error) {
// SetParams sets the auth module's parameters.
// CONTRACT: This method performs no validation of the parameters.
func (ak AccountKeeper) SetParams(ctx context.Context, params types.Params) error {
return ak.ParamsState.Set(ctx, params)
return ak.Params.Set(ctx, params)
}

// GetParams gets the auth module's parameters.
func (ak AccountKeeper) GetParams(ctx context.Context) (params types.Params) {
params, err := ak.ParamsState.Get(ctx)
params, err := ak.Params.Get(ctx)
if err != nil && !errors.Is(err, collections.ErrNotFound) {
panic(err)
}
Expand Down