Skip to content

Commit

Permalink
Fix go problems in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
PvlSport committed May 2, 2024
1 parent 058b130 commit 14a862f
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 321 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.6
github.com/cosmos/gogoproto v1.4.12
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.6.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand Down Expand Up @@ -104,7 +105,6 @@ require (
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/cel-go v0.18.2 // indirect
Expand Down
320 changes: 0 additions & 320 deletions proto/gridnode/gridnode/v1/module/module.pb.go

This file was deleted.

10 changes: 10 additions & 0 deletions testutil/keeper/gridnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ func GridnodeKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {

// Create a mock BankKeeper for testing purposes
bankKeeper := mockBankKeeper()
accountKeeper := mockAccountKeeper()

k := keeper.NewKeeper(
cdc,
paramsSubspace,
bankKeeper, // Pass the bankKeeper as an argument
authority.String(),
runtime.NewKVStoreService(storeKey),
accountKeeper,
)

ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger())
Expand All @@ -67,3 +69,11 @@ func mockBankKeeper() types.BankKeeper {
// with the necessary methods for your tests
return &MockBankKeeper{}
}

// Create a mock BankKeeper for testing purposes
func mockAccountKeeper() types.AccountKeeper {
// Implement your mock BankKeeper here
// This can be a simple struct that fulfills the types.BankKeeper interface
// with the necessary methods for your tests
return &MockAccountKeeper{}
}
Loading

0 comments on commit 14a862f

Please sign in to comment.