Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Dec 16, 2024
1 parent df566c0 commit 08a1bb3
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 47 deletions.
2 changes: 1 addition & 1 deletion scripts/mockgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $mockgen_cmd -source=x/mint/types/expected_keepers.go -package testutil -destina
$mockgen_cmd -source=x/auth/tx/config/expected_keepers.go -package testutil -destination x/auth/tx/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/auth/types/expected_keepers.go -package testutil -destination x/auth/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/auth/ante/expected_keepers.go -package testutil -destination x/auth/ante/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/authz/expected_keepers.go -package testutil -destination x/authz/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/authz//testutil/expected_keepers.go -package testutil -destination x/authz/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/bank/types/expected_keepers.go -package testutil -destination x/bank/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/group/testutil/expected_keepers.go -package testutil -destination x/group/testutil/expected_keepers_mocks.go
$mockgen_cmd -source=x/evidence/types/expected_keepers.go -package testutil -destination x/evidence/testutil/expected_keepers_mocks.go
Expand Down
1 change: 1 addition & 0 deletions x/authz/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (s *TestSuite) SetupTest() {
// gomock initializations
ctrl := gomock.NewController(s.T())
s.bankKeeper = authztestutil.NewMockBankKeeper(ctrl)
s.bankKeeper.EXPECT().Send(gomock.Any(), gomock.Any()).Return(&banktypes.MsgSendResponse{}, nil).AnyTimes()
banktypes.RegisterInterfaces(s.encCfg.InterfaceRegistry)
banktypes.RegisterMsgServer(s.baseApp.MsgServiceRouter(), s.bankKeeper)

Expand Down
29 changes: 0 additions & 29 deletions x/authz/testutil/bank_helpers.go

This file was deleted.

19 changes: 19 additions & 0 deletions x/authz/testutil/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package testutil

import (
"context"

banktypes "cosmossdk.io/x/bank/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)

// BankKeeper extends bank `MsgServer` to mock `Send` and to register handlers in MsgServiceRouter
type BankKeeper interface {
banktypes.MsgServer

SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
}
131 changes: 115 additions & 16 deletions x/authz/testutil/expected_keepers_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/group/testutil/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ type AccountKeeper interface {

// BankKeeper extends bank `MsgServer` to mock `Send` and to register handlers in MsgServiceRouter
type BankKeeper interface {
SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
bank.MsgServer

SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
Expand Down

0 comments on commit 08a1bb3

Please sign in to comment.