Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Oct 7, 2024
1 parent ccf19d3 commit bea9ecc
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions x/bank/keeper/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ func TestBankStateCompatibility(t *testing.T) {
encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{})

env := runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger())
ac := codectestutil.CodecOptions{}.GetAddressCodec()

// gomock initializations
ctrl := gomock.NewController(t)
authKeeper := banktestutil.NewMockAccountKeeper(ctrl)
authKeeper.EXPECT().AddressCodec().Return(ac).AnyTimes()

ac := codectestutil.CodecOptions{}.GetAddressCodec()
addr, err := ac.BytesToString(accAddrs[4])
require.NoError(t, err)
authority, err := ac.BytesToString(authtypes.NewModuleAddress(banktypes.GovModuleName))
Expand All @@ -45,7 +46,6 @@ func TestBankStateCompatibility(t *testing.T) {
k := keeper.NewBaseKeeper(
env,
encCfg.Codec,
ac,
authKeeper,
map[string]bool{addr: true},
authority,
Expand Down
3 changes: 1 addition & 2 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ func (suite *KeeperTestSuite) SetupTest() {
// gomock initializations
ctrl := gomock.NewController(suite.T())
authKeeper := banktestutil.NewMockAccountKeeper(ctrl)
authKeeper.EXPECT().AddressCodec().Return(ac).AnyTimes()
suite.ctx = ctx
suite.authKeeper = authKeeper
suite.addrCdc = ac
suite.bankKeeper = keeper.NewBaseKeeper(
env,
encCfg.Codec,
ac,
suite.authKeeper,
map[string]bool{addr: true},
authority,
Expand Down Expand Up @@ -317,7 +317,6 @@ func (suite *KeeperTestSuite) TestGetAuthority() {
return keeper.NewBaseKeeper(
env,
moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}).Codec,
suite.addrCdc,
suite.authKeeper,
nil,
authority,
Expand Down
1 change: 1 addition & 0 deletions x/bank/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"cosmossdk.io/core/address"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/feegrant/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (

"gotest.tools/v3/assert"

address "cosmossdk.io/core/address"
coretesting "cosmossdk.io/core/testing"
"cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
"cosmossdk.io/x/feegrant"
"cosmossdk.io/x/feegrant/keeper"
"cosmossdk.io/x/feegrant/module"

address "cosmossdk.io/core/address"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
3 changes: 0 additions & 3 deletions x/feegrant/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keeper_test
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/suite"

"cosmossdk.io/core/header"
Expand Down Expand Up @@ -45,8 +44,6 @@ func (suite *KeeperTestSuite) SetupTest() {
encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, module.AppModule{})

// setup gomock and initialize some globally expected executions
ctrl := gomock.NewController(suite.T())

ac := codecaddress.NewBech32Codec("cosmos")
for _, addr := range suite.addrs {
str, err := ac.BytesToString(addr)
Expand Down
2 changes: 0 additions & 2 deletions x/feegrant/module/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package module_test
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"

"cosmossdk.io/core/header"
Expand Down Expand Up @@ -38,7 +37,6 @@ func TestFeegrantPruning(t *testing.T) {
now := testCtx.Ctx.HeaderInfo().Time
oneDay := now.AddDate(0, 0, 1)

ctrl := gomock.NewController(t)
ac := address.NewBech32Codec("cosmos")

env := runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger())
Expand Down

0 comments on commit bea9ecc

Please sign in to comment.