Skip to content

Commit

Permalink
fix: apply recent renames, use aliases if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
JimLarson committed Jun 9, 2021
1 parent 98dbf8a commit d703223
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions golang/cosmos/x/vpurse/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// A subset of github.com/cosmos/cosmos-sdk/x/bank/keeper.Keeper
type BankKeeper interface {
BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
Expand Down
18 changes: 8 additions & 10 deletions golang/cosmos/x/vpurse/vpurse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"testing"

"github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
"github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vpurse/keeper"
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vpurse/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -189,15 +188,14 @@ func (b *mockBank) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, re
}

// makeTestKeeper creates a minimal Keeper for use in testing.
func makeTestKeeper(bank types.BankKeeper) keeper.Keeper {
func makeTestKeeper(bank types.BankKeeper) Keeper {
encodingConfig := params.MakeEncodingConfig()
cdc := encodingConfig.Marshaler
vpurseStoreKey := storetypes.NewKVStoreKey(types.StoreKey)
cdc := encodingConfig.Marshaller
vpurseStoreKey := storetypes.NewKVStoreKey(StoreKey)
callToController := func(ctx sdk.Context, str string) (string, error) {
return "", nil
}
vk := keeper.NewKeeper(cdc, vpurseStoreKey, bank, "feeCollectorName", callToController)
return vk
return NewKeeper(cdc, vpurseStoreKey, bank, "feeCollectorName", callToController)
}

var (
Expand All @@ -210,7 +208,7 @@ func Test_Receive_GetBalance(t *testing.T) {
keeper := makeTestKeeper(bank)
ch := NewPortHandler(AppModule{}, keeper)
sdkCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger())
ctx := &swingset.ControllerContext{Context: sdkCtx}
ctx := &vm.ControllerContext{Context: sdkCtx}

ret, err := ch.Receive(ctx, `{
"type": "VPURSE_GET_BALANCE",
Expand All @@ -237,7 +235,7 @@ func Test_Receive_Give(t *testing.T) {
keeper := makeTestKeeper(bank)
ch := NewPortHandler(AppModule{}, keeper)
sdkCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger())
ctx := &swingset.ControllerContext{Context: sdkCtx}
ctx := &vm.ControllerContext{Context: sdkCtx}

ret, err := ch.Receive(ctx, `{
"type": "VPURSE_GIVE",
Expand Down Expand Up @@ -273,7 +271,7 @@ func Test_Receive_Grab(t *testing.T) {
keeper := makeTestKeeper(bank)
ch := NewPortHandler(AppModule{}, keeper)
sdkCtx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger())
ctx := &swingset.ControllerContext{Context: sdkCtx}
ctx := &vm.ControllerContext{Context: sdkCtx}

ret, err := ch.Receive(ctx, `{
"type": "VPURSE_GRAB",
Expand Down

0 comments on commit d703223

Please sign in to comment.