x/bank: remove alias.go usage (#6439)

* x/bank: remove alias.go usage

* Fix simd_test.go
This commit is contained in:
dauTT 2020-06-15 01:06:16 +02:00 committed by GitHub
parent 8cf8098861
commit 24b9be0ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 110 additions and 183 deletions

View File

@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
func NewTestTxGenerator() client.TxGenerator {
@ -86,7 +86,7 @@ func TestBuildSimTx(t *testing.T) {
WithMemo("memo").
WithChainID("test-chain")
msg := bank.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil)
msg := banktypes.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil)
bz, err := tx.BuildSimTx(txf, msg)
require.NoError(t, err)
require.NotNil(t, bz)
@ -101,7 +101,7 @@ func TestBuildUnsignedTx(t *testing.T) {
WithMemo("memo").
WithChainID("test-chain")
msg := bank.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil)
msg := banktypes.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil)
tx, err := tx.BuildUnsignedTx(txf, msg)
require.NoError(t, err)
require.NotNil(t, tx)

View File

@ -20,6 +20,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
@ -137,7 +139,7 @@ type SimApp struct {
// keepers
AccountKeeper auth.AccountKeeper
BankKeeper bank.Keeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
@ -176,7 +178,7 @@ func NewSimApp(
bApp.SetAppVersion(version.Version)
keys := sdk.NewKVStoreKeys(
auth.StoreKey, bank.StoreKey, stakingtypes.StoreKey,
auth.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
@ -198,7 +200,7 @@ func NewSimApp(
// init params keeper and subspaces
app.ParamsKeeper = paramskeeper.NewKeeper(appCodec, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
app.subspaces[auth.ModuleName] = app.ParamsKeeper.Subspace(auth.DefaultParamspace)
app.subspaces[bank.ModuleName] = app.ParamsKeeper.Subspace(bank.DefaultParamspace)
app.subspaces[banktypes.ModuleName] = app.ParamsKeeper.Subspace(banktypes.DefaultParamspace)
app.subspaces[stakingtypes.ModuleName] = app.ParamsKeeper.Subspace(stakingkeeper.DefaultParamspace)
app.subspaces[minttypes.ModuleName] = app.ParamsKeeper.Subspace(minttypes.DefaultParamspace)
app.subspaces[distrtypes.ModuleName] = app.ParamsKeeper.Subspace(distrtypes.DefaultParamspace)
@ -218,8 +220,8 @@ func NewSimApp(
app.AccountKeeper = auth.NewAccountKeeper(
appCodec, keys[auth.StoreKey], app.subspaces[auth.ModuleName], auth.ProtoBaseAccount, maccPerms,
)
app.BankKeeper = bank.NewBaseKeeper(
appCodec, keys[bank.StoreKey], app.AccountKeeper, app.subspaces[bank.ModuleName], app.BlacklistedAccAddrs(),
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.subspaces[banktypes.ModuleName], app.BlacklistedAccAddrs(),
)
stakingKeeper := stakingkeeper.NewKeeper(
appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.subspaces[stakingtypes.ModuleName],
@ -323,7 +325,7 @@ func NewSimApp(
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
app.mm.SetOrderInitGenesis(
capabilitytypes.ModuleName, auth.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, bank.ModuleName,
capabilitytypes.ModuleName, auth.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, banktypes.ModuleName,
slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName,
ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName,
)

View File

@ -21,7 +21,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/types"
authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
)
@ -88,7 +88,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
// create concrete account type based on input parameters
var genAccount types.GenesisAccount
balances := bank.Balance{Address: addr, Coins: coins.Sort()}
balances := banktypes.Balance{Address: addr, Coins: coins.Sort()}
baseAccount := auth.NewBaseAccount(addr, nil, 0, 0)
if !vestingAmt.IsZero() {
baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd)
@ -140,16 +140,16 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
appState[auth.ModuleName] = authGenStateBz
bankGenState := bank.GetGenesisStateFromAppState(depCdc, appState)
bankGenState := banktypes.GetGenesisStateFromAppState(depCdc, appState)
bankGenState.Balances = append(bankGenState.Balances, balances)
bankGenState.Balances = bank.SanitizeGenesisBalances(bankGenState.Balances)
bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances)
bankGenStateBz, err := cdc.MarshalJSON(bankGenState)
if err != nil {
return fmt.Errorf("failed to marshal bank genesis state: %w", err)
}
appState[bank.ModuleName] = bankGenStateBz
appState[banktypes.ModuleName] = bankGenStateBz
appStateJSON, err := cdc.MarshalJSON(appState)
if err != nil {

View File

@ -19,7 +19,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cosmos/cosmos-sdk/x/staking"
)
@ -47,16 +47,16 @@ func main() {
rootCmd.AddCommand(
genutilcli.InitCmd(ctx, cdc, simapp.ModuleBasics, simapp.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(ctx, cdc, bank.GenesisBalancesIterator{}, simapp.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(ctx, cdc, banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome),
genutilcli.MigrateGenesisCmd(ctx, cdc),
genutilcli.GenTxCmd(
ctx, cdc, simapp.ModuleBasics, staking.AppModuleBasic{},
bank.GenesisBalancesIterator{}, simapp.DefaultNodeHome, simapp.DefaultCLIHome,
banktypes.GenesisBalancesIterator{}, simapp.DefaultNodeHome, simapp.DefaultCLIHome,
),
genutilcli.ValidateGenesisCmd(ctx, cdc, simapp.ModuleBasics),
AddGenesisAccountCmd(ctx, cdc, appCodec, simapp.DefaultNodeHome, simapp.DefaultCLIHome),
flags.NewCompletionCmd(rootCmd, true),
testnetCmd(ctx, cdc, simapp.ModuleBasics, bank.GenesisBalancesIterator{}),
testnetCmd(ctx, cdc, simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(cdc))
server.AddCommands(ctx, cdc, rootCmd, newApp, exportAppStateAndTMValidators)

View File

@ -29,7 +29,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
@ -46,7 +46,7 @@ var (
// get cmd to initialize all files for tendermint testnet and application
func testnetCmd(ctx *server.Context, cdc codec.JSONMarshaler,
mbm module.BasicManager, genBalIterator bank.GenesisBalancesIterator,
mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator,
) *cobra.Command {
cmd := &cobra.Command{
@ -106,7 +106,7 @@ const nodeDirPerm = 0755
// Initialize the testnet
func InitTestnet(
cmd *cobra.Command, config *tmconfig.Config, cdc codec.JSONMarshaler,
mbm module.BasicManager, genBalIterator bank.GenesisBalancesIterator,
mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator,
outputDir, chainID, minGasPrices, nodeDirPrefix, nodeDaemonHome,
nodeCLIHome, startingIPAddress string, numValidators int,
) error {
@ -124,7 +124,7 @@ func InitTestnet(
var (
genAccounts []authtypes.GenesisAccount
genBalances []bank.Balance
genBalances []banktypes.Balance
genFiles []string
)
@ -203,7 +203,7 @@ func InitTestnet(
sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens),
}
genBalances = append(genBalances, bank.Balance{Address: addr, Coins: coins.Sort()})
genBalances = append(genBalances, banktypes.Balance{Address: addr, Coins: coins.Sort()})
genAccounts = append(genAccounts, auth.NewBaseAccount(addr, nil, 0, 0))
valTokens := sdk.TokensFromConsensusPower(100)
@ -258,7 +258,7 @@ func InitTestnet(
func initGenFiles(
cdc codec.JSONMarshaler, mbm module.BasicManager, chainID string,
genAccounts []authtypes.GenesisAccount, genBalances []bank.Balance,
genAccounts []authtypes.GenesisAccount, genBalances []banktypes.Balance,
genFiles []string, numValidators int,
) error {
@ -272,11 +272,11 @@ func initGenFiles(
appGenState[auth.ModuleName] = cdc.MustMarshalJSON(authGenState)
// set the balances in the genesis state
var bankGenState bank.GenesisState
cdc.MustUnmarshalJSON(appGenState[bank.ModuleName], &bankGenState)
var bankGenState banktypes.GenesisState
cdc.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState)
bankGenState.Balances = genBalances
appGenState[bank.ModuleName] = cdc.MustMarshalJSON(bankGenState)
appGenState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankGenState)
appGenStateJSON, err := codec.MarshalJSONIndent(cdc, appGenState)
if err != nil {
@ -302,7 +302,7 @@ func collectGenFiles(
cdc codec.JSONMarshaler, config *tmconfig.Config, chainID string,
monikers, nodeIDs []string, valPubKeys []crypto.PubKey,
numValidators int, outputDir, nodeDirPrefix, nodeDaemonHome string,
genBalIterator bank.GenesisBalancesIterator,
genBalIterator banktypes.GenesisBalancesIterator,
) error {
var appState json.RawMessage

View File

@ -18,7 +18,7 @@ import (
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
@ -157,7 +157,7 @@ func TestAppImportExport(t *testing.T) {
{app.keys[slashingtypes.StoreKey], newApp.keys[slashingtypes.StoreKey], [][]byte{}},
{app.keys[minttypes.StoreKey], newApp.keys[minttypes.StoreKey], [][]byte{}},
{app.keys[distrtypes.StoreKey], newApp.keys[distrtypes.StoreKey], [][]byte{}},
{app.keys[bank.StoreKey], newApp.keys[bank.StoreKey], [][]byte{bank.BalancesPrefix}},
{app.keys[banktypes.StoreKey], newApp.keys[banktypes.StoreKey], [][]byte{banktypes.BalancesPrefix}},
{app.keys[paramtypes.StoreKey], newApp.keys[paramtypes.StoreKey], [][]byte{}},
{app.keys[govtypes.StoreKey], newApp.keys[govtypes.StoreKey], [][]byte{}},
{app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}},

View File

@ -20,7 +20,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp/helpers"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
// DefaultConsensusParams defines the default Tendermint consensus params used in
@ -69,7 +69,7 @@ func Setup(isCheckTx bool) *SimApp {
// SetupWithGenesisAccounts initializes a new SimApp with the provided genesis
// accounts and possible balances.
func SetupWithGenesisAccounts(genAccs []auth.GenesisAccount, balances ...bank.Balance) *SimApp {
func SetupWithGenesisAccounts(genAccs []auth.GenesisAccount, balances ...banktypes.Balance) *SimApp {
db := dbm.NewMemDB()
app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0)
@ -84,8 +84,8 @@ func SetupWithGenesisAccounts(genAccs []auth.GenesisAccount, balances ...bank.Ba
totalSupply = totalSupply.Add(b.Coins...)
}
bankGenesis := bank.NewGenesisState(bank.DefaultGenesisState().SendEnabled, balances, totalSupply)
genesisState[bank.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().SendEnabled, balances, totalSupply)
genesisState[banktypes.ModuleName] = app.Codec().MustMarshalJSON(bankGenesis)
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)
if err != nil {
@ -157,7 +157,7 @@ func AddTestAddrsFromPubKeys(app *SimApp, ctx sdk.Context, pubKeys []crypto.PubK
func setTotalSupply(app *SimApp, ctx sdk.Context, accAmt sdk.Int, totalAccounts int) {
totalSupply := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt.MulRaw(int64(totalAccounts))))
prevSupply := app.BankKeeper.GetSupply(ctx)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(prevSupply.GetTotal().Add(totalSupply...)))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(prevSupply.GetTotal().Add(totalSupply...)))
}
// AddTestAddrs constructs and returns accNum amount of accounts with an

View File

@ -16,7 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/tests/cli"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
func TestCLISimdCollectGentxs(t *testing.T) {
@ -103,7 +103,7 @@ func TestCLISimdAddGenesisAccount(t *testing.T) {
appCodec := std.NewAppCodec(f.Cdc, interfaceRegistry)
accounts := auth.GetGenesisStateFromAppState(appCodec, genesisState).Accounts
balances := bank.GetGenesisStateFromAppState(f.Cdc, genesisState).Balances
balances := banktypes.GetGenesisStateFromAppState(f.Cdc, genesisState).Balances
balancesSet := make(map[string]sdk.Coins)
for _, b := range balances {

View File

@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/signing/amino"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
@ -29,7 +29,7 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
}
memo := "foo"
msgs := []sdk.Msg{
&bank.MsgSend{
&banktypes.MsgSend{
FromAddress: addr1,
ToAddress: addr2,
Amount: coins,

View File

@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/signing/amino"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
func MakeTestHandlerMap() signing.SignModeHandler {
@ -38,7 +38,7 @@ func TestHandlerMap_GetSignBytes(t *testing.T) {
}
memo := "foo"
msgs := []sdk.Msg{
&bank.MsgSend{
&banktypes.MsgSend{
FromAddress: addr1,
ToAddress: addr2,
Amount: coins,

View File

@ -1,75 +0,0 @@
package bank
import (
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
const (
QueryBalance = types.QueryBalance
QueryAllBalances = types.QueryAllBalances
DefaultParamspace = types.DefaultParamspace
DefaultSendEnabled = types.DefaultSendEnabled
EventTypeTransfer = types.EventTypeTransfer
AttributeKeyRecipient = types.AttributeKeyRecipient
AttributeKeySender = types.AttributeKeySender
AttributeValueCategory = types.AttributeValueCategory
ModuleName = types.ModuleName
StoreKey = types.StoreKey
RouterKey = types.RouterKey
QuerierRoute = types.QuerierRoute
)
var (
RegisterInvariants = keeper.RegisterInvariants
NonnegativeBalanceInvariant = keeper.NonnegativeBalanceInvariant
NewBaseKeeper = keeper.NewBaseKeeper
NewBaseSendKeeper = keeper.NewBaseSendKeeper
NewBaseViewKeeper = keeper.NewBaseViewKeeper
RegisterCodec = types.RegisterCodec
ErrNoInputs = types.ErrNoInputs
ErrNoOutputs = types.ErrNoOutputs
ErrInputOutputMismatch = types.ErrInputOutputMismatch
ErrSendDisabled = types.ErrSendDisabled
NewGenesisState = types.NewGenesisState
DefaultGenesisState = types.DefaultGenesisState
SanitizeGenesisBalances = types.SanitizeGenesisBalances
GetGenesisStateFromAppState = types.GetGenesisStateFromAppState
NewMsgSend = types.NewMsgSend
NewMsgMultiSend = types.NewMsgMultiSend
NewInput = types.NewInput
NewOutput = types.NewOutput
ValidateInputsOutputs = types.ValidateInputsOutputs
ParamKeyTable = types.ParamKeyTable
NewQueryBalanceRequest = types.NewQueryBalanceRequest
NewQueryAllBalancesRequest = types.NewQueryAllBalancesRequest
ModuleCdc = types.ModuleCdc
ParamStoreKeySendEnabled = types.ParamStoreKeySendEnabled
BalancesPrefix = types.BalancesPrefix
AddressFromBalancesStore = types.AddressFromBalancesStore
AllInvariants = keeper.AllInvariants
TotalSupply = keeper.TotalSupply
NewSupply = types.NewSupply
DefaultSupply = types.DefaultSupply
)
type (
BaseKeeper = keeper.BaseKeeper
SendKeeper = keeper.SendKeeper
BaseSendKeeper = keeper.BaseSendKeeper
ViewKeeper = keeper.ViewKeeper
BaseViewKeeper = keeper.BaseViewKeeper
Balance = types.Balance
MsgSend = types.MsgSend
MsgMultiSend = types.MsgMultiSend
Input = types.Input
Output = types.Output
QueryBalanceRequest = types.QueryBalanceRequest
QueryAllBalancesRequest = types.QueryAllBalancesRequest
GenesisBalancesIterator = types.GenesisBalancesIterator
Keeper = keeper.Keeper
GenesisState = types.GenesisState
Supply = types.Supply
)

View File

@ -4,16 +4,17 @@ import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
// InitGenesis initializes the bank module's state from a given genesis state.
func InitGenesis(ctx sdk.Context, keeper Keeper, genState GenesisState) {
func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, genState types.GenesisState) {
keeper.SetSendEnabled(ctx, genState.SendEnabled)
var totalSupply sdk.Coins
genState.Balances = SanitizeGenesisBalances(genState.Balances)
genState.Balances = types.SanitizeGenesisBalances(genState.Balances)
for _, balance := range genState.Balances {
if err := keeper.ValidateBalance(ctx, balance.Address); err != nil {
panic(err)
@ -30,11 +31,11 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, genState GenesisState) {
genState.Supply = totalSupply
}
keeper.SetSupply(ctx, NewSupply(genState.Supply))
keeper.SetSupply(ctx, types.NewSupply(genState.Supply))
}
// ExportGenesis returns the bank module's genesis state.
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState {
balancesSet := make(map[string]sdk.Coins)
keeper.IterateAllBalances(ctx, func(addr sdk.AccAddress, balance sdk.Coin) bool {
@ -42,7 +43,7 @@ func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
return false
})
balances := []Balance{}
balances := []types.Balance{}
for addrStr, coins := range balancesSet {
addr, err := sdk.AccAddressFromBech32(addrStr)
@ -50,17 +51,17 @@ func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState {
panic(fmt.Errorf("failed to convert address from string: %w", err))
}
balances = append(balances, Balance{
balances = append(balances, types.Balance{
Address: addr,
Coins: coins,
})
}
return NewGenesisState(keeper.GetSendEnabled(ctx), balances, keeper.GetSupply(ctx).GetTotal())
return types.NewGenesisState(keeper.GetSendEnabled(ctx), balances, keeper.GetSupply(ctx).GetTotal())
}
// ValidateGenesis performs basic validation of supply genesis data returning an
// error for any failed validation criteria.
func ValidateGenesis(data GenesisState) error {
func ValidateGenesis(data types.GenesisState) error {
return types.NewSupply(data.Supply).ValidateBasic()
}

View File

@ -6,7 +6,6 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -73,7 +72,7 @@ func (suite *IntegrationTestSuite) TestQueryAllBalances() {
func (suite *IntegrationTestSuite) TestQueryTotalSupply() {
app, ctx := suite.app, suite.ctx
expectedTotalSupply := bank.NewSupply(sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)))
expectedTotalSupply := types.NewSupply(sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)))
app.BankKeeper.SetSupply(ctx, expectedTotalSupply)
queryHelper := baseapp.NewQueryServerTestHelper(ctx)
@ -92,7 +91,7 @@ func (suite *IntegrationTestSuite) TestQueryTotalSupplyOf() {
test1Supply := sdk.NewInt64Coin("test1", 4000000)
test2Supply := sdk.NewInt64Coin("test2", 700000000)
expectedTotalSupply := bank.NewSupply(sdk.NewCoins(test1Supply, test2Supply))
expectedTotalSupply := types.NewSupply(sdk.NewCoins(test1Supply, test2Supply))
app.BankKeeper.SetSupply(ctx, expectedTotalSupply)
queryHelper := baseapp.NewQueryServerTestHelper(ctx)

View File

@ -13,7 +13,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -46,7 +46,7 @@ func newBarCoin(amt int64) sdk.Coin {
}
// nolint: interfacer
func getCoinsByName(ctx sdk.Context, bk bank.Keeper, ak types.AccountKeeper, moduleName string) sdk.Coins {
func getCoinsByName(ctx sdk.Context, bk keeper.Keeper, ak types.AccountKeeper, moduleName string) sdk.Coins {
moduleAddress := ak.GetModuleAddress(moduleName)
macc := ak.GetAccount(ctx, moduleAddress)
if macc == nil {
@ -104,9 +104,9 @@ func (suite *IntegrationTestSuite) TestSupply_SendCoins() {
appCodec, app.GetKey(types.StoreKey), app.GetSubspace(types.ModuleName),
auth.ProtoBaseAccount, maccPerms,
)
keeper := bank.NewBaseKeeper(
keeper := keeper.NewBaseKeeper(
appCodec, app.GetKey(types.StoreKey), authKeeper,
app.GetSubspace(bank.ModuleName), make(map[string]bool),
app.GetSubspace(types.ModuleName), make(map[string]bool),
)
baseAcc := authKeeper.NewAccountWithAddress(ctx, auth.NewModuleAddress("baseAcc"))
@ -167,9 +167,9 @@ func (suite *IntegrationTestSuite) TestSupply_MintCoins() {
appCodec, app.GetKey(types.StoreKey), app.GetSubspace(types.ModuleName),
auth.ProtoBaseAccount, maccPerms,
)
keeper := bank.NewBaseKeeper(
keeper := keeper.NewBaseKeeper(
appCodec, app.GetKey(types.StoreKey), authKeeper,
app.GetSubspace(bank.ModuleName), make(map[string]bool),
app.GetSubspace(types.ModuleName), make(map[string]bool),
)
authKeeper.SetModuleAccount(ctx, burnerAcc)
@ -221,9 +221,9 @@ func (suite *IntegrationTestSuite) TestSupply_BurnCoins() {
appCodec, app.GetKey(types.StoreKey), app.GetSubspace(types.ModuleName),
auth.ProtoBaseAccount, maccPerms,
)
keeper := bank.NewBaseKeeper(
keeper := keeper.NewBaseKeeper(
appCodec, app.GetKey(types.StoreKey), authKeeper,
app.GetSubspace(bank.ModuleName), make(map[string]bool),
app.GetSubspace(types.ModuleName), make(map[string]bool),
)
suite.Require().NoError(keeper.SetBalances(ctx, burnerAcc.GetAddress(), initCoins))

View File

@ -7,7 +7,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"
)
@ -86,7 +85,7 @@ func (suite *IntegrationTestSuite) TestQuerier_QueryAllBalances() {
func (suite *IntegrationTestSuite) TestQuerier_QueryTotalSupply() {
app, ctx := suite.app, suite.ctx
expectedTotalSupply := bank.NewSupply(sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)))
expectedTotalSupply := types.NewSupply(sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)))
app.BankKeeper.SetSupply(ctx, expectedTotalSupply)
req := abci.RequestQuery{
@ -115,7 +114,7 @@ func (suite *IntegrationTestSuite) TestQuerier_QueryTotalSupplyOf() {
test1Supply := sdk.NewInt64Coin("test1", 4000000)
test2Supply := sdk.NewInt64Coin("test2", 700000000)
expectedTotalSupply := bank.NewSupply(sdk.NewCoins(test1Supply, test2Supply))
expectedTotalSupply := types.NewSupply(sdk.NewCoins(test1Supply, test2Supply))
app.BankKeeper.SetSupply(ctx, expectedTotalSupply)
req := abci.RequestQuery{

View File

@ -37,22 +37,22 @@ type AppModuleBasic struct {
}
// Name returns the bank module's name.
func (AppModuleBasic) Name() string { return ModuleName }
func (AppModuleBasic) Name() string { return types.ModuleName }
// RegisterCodec registers the bank module's types for the given codec.
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec) { RegisterCodec(cdc) }
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec) { types.RegisterCodec(cdc) }
// DefaultGenesis returns default genesis state as raw bytes for the bank
// module.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage {
return cdc.MustMarshalJSON(DefaultGenesisState())
return cdc.MustMarshalJSON(types.DefaultGenesisState())
}
// ValidateGenesis performs genesis state validation for the bank module.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, bz json.RawMessage) error {
var data GenesisState
var data types.GenesisState
if err := cdc.UnmarshalJSON(bz, &data); err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", ModuleName, err)
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
}
return ValidateGenesis(data)
@ -84,14 +84,14 @@ func (AppModuleBasic) RegisterInterfaceTypes(registry codectypes.InterfaceRegist
type AppModule struct {
AppModuleBasic
keeper Keeper
keeper keeper.Keeper
accountKeeper types.AccountKeeper
}
func (am AppModule) RegisterQueryService(grpc.Server) {}
// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Marshaler, keeper Keeper, accountKeeper types.AccountKeeper) AppModule {
func NewAppModule(cdc codec.Marshaler, keeper keeper.Keeper, accountKeeper types.AccountKeeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},
keeper: keeper,
@ -100,7 +100,7 @@ func NewAppModule(cdc codec.Marshaler, keeper Keeper, accountKeeper types.Accoun
}
// Name returns the bank module's name.
func (AppModule) Name() string { return ModuleName }
func (AppModule) Name() string { return types.ModuleName }
// RegisterInvariants registers the bank module invariants.
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
@ -109,11 +109,11 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
// Route returns the message routing key for the bank module.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(RouterKey, NewHandler(am.keeper))
return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper))
}
// QuerierRoute returns the bank module's querier route name.
func (AppModule) QuerierRoute() string { return RouterKey }
func (AppModule) QuerierRoute() string { return types.RouterKey }
// NewQuerierHandler returns the bank module sdk.Querier.
func (am AppModule) NewQuerierHandler() sdk.Querier {
@ -123,7 +123,7 @@ func (am AppModule) NewQuerierHandler() sdk.Querier {
// InitGenesis performs genesis initialization for the bank module. It returns
// no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState
var genesisState types.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, am.keeper, genesisState)
return []abci.ValidatorUpdate{}
@ -166,7 +166,7 @@ func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange {
// RegisterStoreDecoder registers a decoder for supply module's types
func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) {
sdr[StoreKey] = simulation.NewDecodeStore(am.keeper)
sdr[types.StoreKey] = simulation.NewDecodeStore(am.keeper)
}
// WeightedOperations returns the all the gov module operations with their respective weights.

View File

@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/capability/keeper"
"github.com/cosmos/cosmos-sdk/x/capability/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
}
func (suite *KeeperTestSuite) TestInitializeAndSeal() {
sk := suite.keeper.ScopeToModule(bank.ModuleName)
sk := suite.keeper.ScopeToModule(banktypes.ModuleName)
caps := make([]*types.Capability, 5)
// Get Latest Index before creating new ones to sychronize indices correctly
@ -73,7 +73,7 @@ func (suite *KeeperTestSuite) TestInitializeAndSeal() {
}
func (suite *KeeperTestSuite) TestNewCapability() {
sk := suite.keeper.ScopeToModule(bank.ModuleName)
sk := suite.keeper.ScopeToModule(banktypes.ModuleName)
cap, err := sk.NewCapability(suite.ctx, "transfer")
suite.Require().NoError(err)
@ -104,7 +104,7 @@ func (suite *KeeperTestSuite) TestOriginalCapabilityKeeper() {
}
func (suite *KeeperTestSuite) TestAuthenticateCapability() {
sk1 := suite.keeper.ScopeToModule(bank.ModuleName)
sk1 := suite.keeper.ScopeToModule(banktypes.ModuleName)
sk2 := suite.keeper.ScopeToModule(stakingtypes.ModuleName)
cap1, err := sk1.NewCapability(suite.ctx, "transfer")
@ -139,7 +139,7 @@ func (suite *KeeperTestSuite) TestAuthenticateCapability() {
}
func (suite *KeeperTestSuite) TestClaimCapability() {
sk1 := suite.keeper.ScopeToModule(bank.ModuleName)
sk1 := suite.keeper.ScopeToModule(banktypes.ModuleName)
sk2 := suite.keeper.ScopeToModule(stakingtypes.ModuleName)
cap, err := sk1.NewCapability(suite.ctx, "transfer")
@ -159,7 +159,7 @@ func (suite *KeeperTestSuite) TestClaimCapability() {
}
func (suite *KeeperTestSuite) TestGetOwners() {
sk1 := suite.keeper.ScopeToModule(bank.ModuleName)
sk1 := suite.keeper.ScopeToModule(banktypes.ModuleName)
sk2 := suite.keeper.ScopeToModule(stakingtypes.ModuleName)
sk3 := suite.keeper.ScopeToModule("foo")
@ -172,7 +172,7 @@ func (suite *KeeperTestSuite) TestGetOwners() {
suite.Require().NoError(sk2.ClaimCapability(suite.ctx, cap, "transfer"))
suite.Require().NoError(sk3.ClaimCapability(suite.ctx, cap, "transfer"))
expectedOrder := []string{bank.ModuleName, "foo", stakingtypes.ModuleName}
expectedOrder := []string{banktypes.ModuleName, "foo", stakingtypes.ModuleName}
// Ensure all scoped keepers can get owners
for _, sk := range sks {
owners, ok := sk.GetOwners(suite.ctx, "transfer")
@ -198,7 +198,7 @@ func (suite *KeeperTestSuite) TestGetOwners() {
suite.Require().Nil(err, "could not release capability")
// new expected order and scoped capabilities
expectedOrder = []string{bank.ModuleName, stakingtypes.ModuleName}
expectedOrder = []string{banktypes.ModuleName, stakingtypes.ModuleName}
sks = []keeper.ScopedKeeper{sk1, sk2}
// Ensure all scoped keepers can get owners
@ -224,7 +224,7 @@ func (suite *KeeperTestSuite) TestGetOwners() {
}
func (suite *KeeperTestSuite) TestReleaseCapability() {
sk1 := suite.keeper.ScopeToModule(bank.ModuleName)
sk1 := suite.keeper.ScopeToModule(banktypes.ModuleName)
sk2 := suite.keeper.ScopeToModule(stakingtypes.ModuleName)
cap1, err := sk1.NewCapability(suite.ctx, "transfer")
@ -251,7 +251,7 @@ func (suite *KeeperTestSuite) TestReleaseCapability() {
}
func (suite KeeperTestSuite) TestRevertCapability() {
sk := suite.keeper.ScopeToModule(bank.ModuleName)
sk := suite.keeper.ScopeToModule(banktypes.ModuleName)
ms := suite.ctx.MultiStore()

View File

@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
"github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
@ -39,7 +39,7 @@ func createTestApp() (*simapp.SimApp, sdk.Context, []sdk.AccAddress) {
feePool := distrtypes.InitialFeePool()
feePool.CommunityPool = sdk.NewDecCoinsFromCoins(sdk.NewCoins(constantFee)...)
app.DistrKeeper.SetFeePool(ctx, feePool)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(sdk.Coins{}))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(sdk.Coins{}))
addrs := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(10000))

View File

@ -10,7 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/distribution/keeper"
"github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/staking"
@ -112,7 +112,7 @@ func getQueriedCommunityPool(t *testing.T, ctx sdk.Context, cdc *codec.Codec, qu
func TestQueries(t *testing.T) {
cdc := codec.New()
types.RegisterCodec(cdc)
bank.RegisterCodec(cdc)
banktypes.RegisterCodec(cdc)
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abci.Header{})

View File

@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
"github.com/cosmos/cosmos-sdk/x/evidence/keeper"
"github.com/cosmos/cosmos-sdk/x/evidence/types"
@ -122,7 +122,7 @@ func (suite *KeeperTestSuite) populateValidators(ctx sdk.Context) {
// add accounts and set total supply
totalSupplyAmt := initAmt.MulRaw(int64(len(valAddresses)))
totalSupply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupplyAmt))
suite.app.BankKeeper.SetSupply(ctx, bank.NewSupply(totalSupply))
suite.app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply))
for _, addr := range valAddresses {
_, err := suite.app.BankKeeper.AddCoins(ctx, sdk.AccAddress(addr), initCoins)

View File

@ -12,6 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/cosmos-sdk/x/gov/types"
)
@ -57,7 +58,7 @@ func TestImportExportQueues(t *testing.T) {
genesisState := simapp.NewDefaultGenesisState()
genesisState[auth.ModuleName] = app.AppCodec().MustMarshalJSON(authGenState)
genesisState[bank.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenState)
genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenState)
genesisState[types.ModuleName] = app.AppCodec().MustMarshalJSON(govGenState)
stateBytes, err := codec.MarshalJSONIndent(app.Codec(), genesisState)

View File

@ -14,7 +14,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
transfer "github.com/cosmos/cosmos-sdk/x/ibc-transfer"
"github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"
connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types"
@ -113,7 +113,7 @@ func (suite *HandlerTestSuite) TestHandleMsgTransfer() {
suite.Require().Nil(res, "%+v", res) // incorrect denom prefix
msg = types.NewMsgTransfer(testPort1, testChannel1, testPrefixedCoins1, testAddr1, testAddr2.String(), 110, 0)
suite.chainA.App.BankKeeper.SetSupply(ctx, bank.NewSupply(testPrefixedCoins1))
suite.chainA.App.BankKeeper.SetSupply(ctx, banktypes.NewSupply(testPrefixedCoins1))
_ = suite.chainA.App.BankKeeper.SetBalances(ctx, testAddr1, testPrefixedCoins1)
res, err = handler(ctx, msg)

View File

@ -4,7 +4,7 @@ import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"
connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection"
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
@ -32,7 +32,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() {
}, true, true},
{"successful transfer from external chain", prefixCoins,
func() {
suite.chainA.App.BankKeeper.SetSupply(suite.chainA.GetContext(), bank.NewSupply(prefixCoins))
suite.chainA.App.BankKeeper.SetSupply(suite.chainA.GetContext(), banktypes.NewSupply(prefixCoins))
_, err := suite.chainA.App.BankKeeper.AddCoins(suite.chainA.GetContext(), testAddr1, prefixCoins)
suite.Require().NoError(err)
suite.chainA.CreateClient(suite.chainB)

View File

@ -12,7 +12,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -46,7 +46,7 @@ func TestSlashingMsgs(t *testing.T) {
Address: addr1,
}
accs := authtypes.GenesisAccounts{acc1}
balances := []bank.Balance{
balances := []banktypes.Balance{
{
Address: addr1,
Coins: sdk.Coins{genCoin},

View File

@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -47,7 +47,7 @@ func TestStakingMsgs(t *testing.T) {
acc1 := &auth.BaseAccount{Address: addr1}
acc2 := &auth.BaseAccount{Address: addr2}
accs := auth.GenesisAccounts{acc1, acc2}
balances := []bank.Balance{
balances := []banktypes.Balance{
{
Address: addr1,
Coins: sdk.Coins{genCoin},

View File

@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -29,7 +29,7 @@ func bootstrapGenesisTest(t *testing.T, power int64, numAddrs int) (*simapp.SimA
require.NoError(t, err)
app.AccountKeeper.SetModuleAccount(ctx, notBondedPool)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(totalSupply))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply))
return app, ctx, addrDels
}

View File

@ -15,7 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/cosmos-sdk/x/staking/types"
@ -34,7 +34,7 @@ func bootstrapHandlerGenesisTest(t *testing.T, power int64, numAddrs int, accAmo
require.NoError(t, err)
app.AccountKeeper.SetModuleAccount(ctx, notBondedPool)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(totalSupply))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply))
return app, ctx, addrDels, addrVals
}

View File

@ -10,7 +10,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -38,7 +38,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*simapp.SimApp, sdk.Context,
require.NoError(t, err)
app.AccountKeeper.SetModuleAccount(ctx, bondedPool)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(totalSupply))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply))
for i := int64(0); i < numVals; i++ {
validator := types.NewValidator(addrVals[i], PKs[i], types.Description{})

View File

@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/bank"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -29,7 +29,7 @@ func bootstrapValidatorTest(t *testing.T, power int64, numAddrs int) (*simapp.Si
require.NoError(t, err)
app.AccountKeeper.SetModuleAccount(ctx, notBondedPool)
app.BankKeeper.SetSupply(ctx, bank.NewSupply(totalSupply))
app.BankKeeper.SetSupply(ctx, banktypes.NewSupply(totalSupply))
return app, ctx, addrDels, addrVals
}