Skip to content

Commit

Permalink
fix Proto and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed Dec 19, 2023
1 parent 4bb2d50 commit dc17911
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 49 deletions.
45 changes: 22 additions & 23 deletions api/cosmos/bank/v1beta1/events.pulsar.go

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

5 changes: 2 additions & 3 deletions proto/cosmos/bank/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ message BalanceUpdate {
// the latest amount
string amt = 3 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
(gogoproto.customtype) = "cosmossdk.io/math.Int",
(gogoproto.nullable) = false
];
}
8 changes: 8 additions & 0 deletions server/mock/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ func (ms multiStore) WorkingHash() []byte {
panic("not implemented")
}

func (ms multiStore) SetCommitSync(_ bool) {
panic("not implemented")
}

func (ms multiStore) GetCommitSync() bool {
panic("not implemented")
}

var _ storetypes.KVStore = kvStore{}

type kvStore struct {
Expand Down
3 changes: 3 additions & 0 deletions x/bank/keeper/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import (

func TestBankStateCompatibility(t *testing.T) {
key := storetypes.NewKVStoreKey(banktypes.StoreKey)
tKey := storetypes.NewTransientStoreKey("transient_key")
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()})
encCfg := moduletestutil.MakeTestEncodingConfig()

storeService := runtime.NewKVStoreService(key)
tStoreService := runtime.NewTransientKVStoreService(tKey)

// gomock initializations
ctrl := gomock.NewController(t)
Expand All @@ -40,6 +42,7 @@ func TestBankStateCompatibility(t *testing.T) {
k := keeper.NewBaseKeeper(
encCfg.Codec,
storeService,
tStoreService,
authKeeper,
map[string]bool{accAddrs[4].String(): true},
authtypes.NewModuleAddress("gov").String(),
Expand Down
6 changes: 6 additions & 0 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ func TestKeeperTestSuite(t *testing.T) {

func (suite *KeeperTestSuite) SetupTest() {
key := storetypes.NewKVStoreKey(banktypes.StoreKey)
tKey := storetypes.NewTransientStoreKey("transient_key")
testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test"))
ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()})
encCfg := moduletestutil.MakeTestEncodingConfig()

storeService := runtime.NewKVStoreService(key)
tStoreService := runtime.NewTransientKVStoreService(tKey)

// gomock initializations
ctrl := gomock.NewController(suite.T())
Expand All @@ -145,6 +147,7 @@ func (suite *KeeperTestSuite) SetupTest() {
suite.bankKeeper = keeper.NewBaseKeeper(
encCfg.Codec,
storeService,
tStoreService,
suite.authKeeper,
map[string]bool{accAddrs[4].String(): true},
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Expand Down Expand Up @@ -312,10 +315,13 @@ func (suite *KeeperTestSuite) TestPrependSendRestriction() {

func (suite *KeeperTestSuite) TestGetAuthority() {
storeService := runtime.NewKVStoreService(storetypes.NewKVStoreKey(banktypes.StoreKey))
tStoreService := runtime.NewTransientKVStoreService(storetypes.NewTransientStoreKey("transient_key"))

NewKeeperWithAuthority := func(authority string) keeper.BaseKeeper {
return keeper.NewBaseKeeper(
moduletestutil.MakeTestEncodingConfig().Codec,
storeService,
tStoreService,
suite.authKeeper,
nil,
authority,
Expand Down
46 changes: 23 additions & 23 deletions x/bank/types/events.pb.go

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

0 comments on commit dc17911

Please sign in to comment.