Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Sep 9, 2024
1 parent 2ac9275 commit 660e601
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions x/bank/v2/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ModuleInputs struct {
Cdc codec.Codec
Environment appmodule.Environment
AddressCodec address.Codec
AccountKeeper types.AccountKeeper
AuthKeeper types.AuthKeeper
}

type ModuleOutputs struct {
Expand All @@ -54,7 +54,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs {
}
}

k := keeper.NewKeeper(authority, in.AddressCodec, in.Environment, in.Cdc, in.AccountKeeper)
k := keeper.NewKeeper(authority, in.AddressCodec, in.Environment, in.Cdc, in.AuthKeeper)
m := NewAppModule(in.Cdc, k)

return ModuleOutputs{
Expand Down
8 changes: 4 additions & 4 deletions x/bank/v2/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
type Keeper struct {
appmodulev2.Environment

ak types.AccountKeeper
ak types.AuthKeeper
authority []byte
addressCodec address.Codec
schema collections.Schema
Expand All @@ -33,7 +33,7 @@ type Keeper struct {
supply collections.Map[string, math.Int]
}

func NewKeeper(authority []byte, addressCodec address.Codec, env appmodulev2.Environment, cdc codec.BinaryCodec, ak types.AccountKeeper) *Keeper {
func NewKeeper(authority []byte, addressCodec address.Codec, env appmodulev2.Environment, cdc codec.BinaryCodec, ak types.AuthKeeper) *Keeper {
sb := collections.NewSchemaBuilder(env.KVStoreService)

k := &Keeper{
Expand All @@ -58,7 +58,7 @@ func NewKeeper(authority []byte, addressCodec address.Codec, env appmodulev2.Env
// MintCoins creates new coins from thin air and adds it to the module account.
// An error is returned if the module account does not exist or is unauthorized.
func (k Keeper) MintCoins(ctx context.Context, moduleName string, amounts sdk.Coins) error {

// TODO: Mint restriction
acc := k.ak.GetModuleAccount(ctx, moduleName)
if acc == nil {
Expand Down Expand Up @@ -129,7 +129,7 @@ func (k Keeper) SendCoins(ctx context.Context, from, to string, amt sdk.Coins) e
return fmt.Errorf("%s is not an address or module name", to)
}
}

// TODO: Send restriction

err = k.subUnlockedCoins(ctx, fromAddr, amt)
Expand Down
4 changes: 2 additions & 2 deletions x/bank/v2/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// AccountKeeper defines the account contract that must be fulfilled when
// AuthKeeper defines the account contract that must be fulfilled when
// creating a x/bank keeper.
type AccountKeeper interface {
type AuthKeeper interface {
GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI
GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI
GetModuleAddress(moduleName string) sdk.AccAddress
Expand Down

0 comments on commit 660e601

Please sign in to comment.