refactor: Move x/auth's AccountI and ModuleAccountI interfaces to types package (#13937)
This commit is contained in:
parent
03196d7d57
commit
36069956e3
@ -13,6 +13,7 @@ import (
|
||||
|
||||
"cosmossdk.io/math"
|
||||
simappparams "cosmossdk.io/simapp/params"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
@ -397,7 +397,7 @@ func (s *E2ETestSuite) TestCLISignAminoJSON() {
|
||||
// query account info
|
||||
queryResJSON, err := authclitestutil.QueryAccountExec(val1.ClientCtx, val1.Address)
|
||||
require.NoError(err)
|
||||
var account authtypes.AccountI
|
||||
var account sdk.AccountI
|
||||
require.NoError(val1.ClientCtx.Codec.UnmarshalInterfaceJSON(queryResJSON.Bytes(), &account))
|
||||
|
||||
/**** test signature-only ****/
|
||||
@ -1327,7 +1327,7 @@ func (s *E2ETestSuite) TestMultisignBatch() {
|
||||
|
||||
queryResJSON, err := authclitestutil.QueryAccountExec(val.ClientCtx, addr)
|
||||
s.Require().NoError(err)
|
||||
var account authtypes.AccountI
|
||||
var account sdk.AccountI
|
||||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalInterfaceJSON(queryResJSON.Bytes(), &account))
|
||||
|
||||
// sign-batch file
|
||||
@ -1398,7 +1398,7 @@ func (s *E2ETestSuite) TestGetAccountCmd() {
|
||||
s.Require().Error(err)
|
||||
s.Require().NotEqual("internal", err.Error())
|
||||
} else {
|
||||
var acc authtypes.AccountI
|
||||
var acc sdk.AccountI
|
||||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalInterfaceJSON(out.Bytes(), &acc))
|
||||
s.Require().Equal(val.Address, acc.GetAddress())
|
||||
}
|
||||
@ -1456,11 +1456,11 @@ func (s *E2ETestSuite) TestQueryModuleAccountByNameCmd() {
|
||||
var res authtypes.QueryModuleAccountByNameResponse
|
||||
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res))
|
||||
|
||||
var account authtypes.AccountI
|
||||
var account sdk.AccountI
|
||||
err := val.ClientCtx.InterfaceRegistry.UnpackAny(res.Account, &account)
|
||||
s.Require().NoError(err)
|
||||
|
||||
moduleAccount, ok := account.(authtypes.ModuleAccountI)
|
||||
moduleAccount, ok := account.(sdk.ModuleAccountI)
|
||||
s.Require().True(ok)
|
||||
s.Require().Equal(tc.moduleName, moduleAccount.GetName())
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import (
|
||||
|
||||
crgerrs "cosmossdk.io/tools/rosetta/lib/errors"
|
||||
crgtypes "cosmossdk.io/tools/rosetta/lib/types"
|
||||
|
||||
sdkclient "github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
|
||||
42
types/account.go
Normal file
42
types/account.go
Normal file
@ -0,0 +1,42 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
)
|
||||
|
||||
// AccountI is an interface used to store coins at a given address within state.
|
||||
// It presumes a notion of sequence numbers for replay protection,
|
||||
// a notion of account numbers for replay protection for previously pruned accounts,
|
||||
// and a pubkey for authentication purposes.
|
||||
//
|
||||
// Many complex conditions can be used in the concrete struct which implements AccountI.
|
||||
type AccountI interface {
|
||||
proto.Message
|
||||
|
||||
GetAddress() AccAddress
|
||||
SetAddress(AccAddress) error // errors if already set.
|
||||
|
||||
GetPubKey() cryptotypes.PubKey // can return nil.
|
||||
SetPubKey(cryptotypes.PubKey) error
|
||||
|
||||
GetAccountNumber() uint64
|
||||
SetAccountNumber(uint64) error
|
||||
|
||||
GetSequence() uint64
|
||||
SetSequence(uint64) error
|
||||
|
||||
// Ensure that account implements stringer
|
||||
String() string
|
||||
}
|
||||
|
||||
// ModuleAccountI defines an account interface for modules that hold tokens in
|
||||
// an escrow.
|
||||
type ModuleAccountI interface {
|
||||
AccountI
|
||||
|
||||
GetName() string
|
||||
GetPermissions() []string
|
||||
HasPermission(string) bool
|
||||
}
|
||||
@ -9,8 +9,8 @@ import (
|
||||
// Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators.
|
||||
type AccountKeeper interface {
|
||||
GetParams(ctx sdk.Context) (params types.Params)
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
SetAccount(ctx sdk.Context, acc types.AccountI)
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
SetAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
GetModuleAddress(moduleName string) sdk.AccAddress
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ func (dfd DeductFeeDecorator) checkDeductFee(ctx sdk.Context, sdkTx sdk.Tx, fee
|
||||
}
|
||||
|
||||
// DeductFees deducts fees from the given account.
|
||||
func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc types.AccountI, fees sdk.Coins) error {
|
||||
func DeductFees(bankKeeper types.BankKeeper, ctx sdk.Context, acc sdk.AccountI, fees sdk.Coins) error {
|
||||
if !fees.IsValid() {
|
||||
return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "invalid fee amount: %s", fees)
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ func ConsumeMultisignatureVerificationGas(
|
||||
|
||||
// GetSignerAcc returns an account for a given address that is expected to sign
|
||||
// a transaction.
|
||||
func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (types.AccountI, error) {
|
||||
func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (sdk.AccountI, error) {
|
||||
if acc := ak.GetAccount(ctx, addr); acc != nil {
|
||||
return acc, nil
|
||||
}
|
||||
|
||||
@ -36,10 +36,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ func (mr *MockAccountKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ import (
|
||||
|
||||
// TestAccount represents an account used in the tests in x/auth/ante.
|
||||
type TestAccount struct {
|
||||
acc types.AccountI
|
||||
acc sdk.AccountI
|
||||
priv cryptotypes.PrivKey
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
// NewAccountWithAddress implements AccountKeeperI.
|
||||
func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI {
|
||||
func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI {
|
||||
acc := ak.proto()
|
||||
err := acc.SetAddress(addr)
|
||||
if err != nil {
|
||||
@ -17,7 +17,7 @@ func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddre
|
||||
}
|
||||
|
||||
// NewAccount sets the next account number to a given account interface
|
||||
func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc types.AccountI) types.AccountI {
|
||||
func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc sdk.AccountI) sdk.AccountI {
|
||||
if err := acc.SetAccountNumber(ak.NextAccountNumber(ctx)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -38,7 +38,7 @@ func (ak AccountKeeper) HasAccountAddressByID(ctx sdk.Context, id uint64) bool {
|
||||
}
|
||||
|
||||
// GetAccount implements AccountKeeperI.
|
||||
func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI {
|
||||
func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI {
|
||||
store := ctx.KVStore(ak.storeKey)
|
||||
bz := store.Get(types.AddressStoreKey(addr))
|
||||
if bz == nil {
|
||||
@ -59,8 +59,8 @@ func (ak AccountKeeper) GetAccountAddressByID(ctx sdk.Context, id uint64) string
|
||||
}
|
||||
|
||||
// GetAllAccounts returns all accounts in the accountKeeper.
|
||||
func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.AccountI) {
|
||||
ak.IterateAccounts(ctx, func(acc types.AccountI) (stop bool) {
|
||||
func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []sdk.AccountI) {
|
||||
ak.IterateAccounts(ctx, func(acc sdk.AccountI) (stop bool) {
|
||||
accounts = append(accounts, acc)
|
||||
return false
|
||||
})
|
||||
@ -69,7 +69,7 @@ func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) (accounts []types.Accoun
|
||||
}
|
||||
|
||||
// SetAccount implements AccountKeeperI.
|
||||
func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) {
|
||||
func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc sdk.AccountI) {
|
||||
addr := acc.GetAddress()
|
||||
store := ctx.KVStore(ak.storeKey)
|
||||
|
||||
@ -84,7 +84,7 @@ func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc types.AccountI) {
|
||||
|
||||
// RemoveAccount removes an account for the account mapper store.
|
||||
// NOTE: this will cause supply invariant violation if called
|
||||
func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI) {
|
||||
func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc sdk.AccountI) {
|
||||
addr := acc.GetAddress()
|
||||
store := ctx.KVStore(ak.storeKey)
|
||||
store.Delete(types.AddressStoreKey(addr))
|
||||
@ -93,7 +93,7 @@ func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc types.AccountI) {
|
||||
|
||||
// IterateAccounts iterates over all the stored accounts and performs a callback function.
|
||||
// Stops iteration when callback returns true.
|
||||
func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account types.AccountI) (stop bool)) {
|
||||
func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, cb func(account sdk.AccountI) (stop bool)) {
|
||||
store := ctx.KVStore(ak.storeKey)
|
||||
iterator := sdk.KVStorePrefixIterator(store, types.AddressStoreKeyPrefix)
|
||||
|
||||
|
||||
@ -77,8 +77,8 @@ func (suite *DeterministicTestSuite) SetupTest() {
|
||||
}
|
||||
|
||||
// createAndSetAccount creates a random account and sets to the keeper store.
|
||||
func (suite *DeterministicTestSuite) createAndSetAccounts(t *rapid.T, count int) []types.AccountI {
|
||||
accs := make([]types.AccountI, 0, count)
|
||||
func (suite *DeterministicTestSuite) createAndSetAccounts(t *rapid.T, count int) []sdk.AccountI {
|
||||
accs := make([]sdk.AccountI, 0, count)
|
||||
|
||||
// We need all generated account-numbers unique
|
||||
accNums := rapid.SliceOfNDistinct(rapid.Uint64(), count, count, func(i uint64) uint64 { return i }).Draw(t, "acc-numss")
|
||||
@ -239,12 +239,12 @@ func (suite *DeterministicTestSuite) createAndReturnQueryClient(ak keeper.Accoun
|
||||
|
||||
func (suite *DeterministicTestSuite) setModuleAccounts(
|
||||
ctx sdk.Context, ak keeper.AccountKeeper, maccs []string,
|
||||
) []types.AccountI {
|
||||
) []sdk.AccountI {
|
||||
sort.Strings(maccs)
|
||||
moduleAccounts := make([]types.AccountI, 0, len(maccs))
|
||||
moduleAccounts := make([]sdk.AccountI, 0, len(maccs))
|
||||
for _, m := range maccs {
|
||||
acc, _ := ak.GetModuleAccountAndPermissions(ctx, m)
|
||||
acc1, ok := acc.(types.AccountI)
|
||||
acc1, ok := acc.(sdk.AccountI)
|
||||
suite.Require().True(ok)
|
||||
moduleAccounts = append(moduleAccounts, acc1)
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ func (ak AccountKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
|
||||
params := ak.GetParams(ctx)
|
||||
|
||||
var genAccounts types.GenesisAccounts
|
||||
ak.IterateAccounts(ctx, func(account types.AccountI) bool {
|
||||
ak.IterateAccounts(ctx, func(account sdk.AccountI) bool {
|
||||
genAccount := account.(types.GenesisAccount)
|
||||
genAccounts = append(genAccounts, genAccount)
|
||||
return false
|
||||
|
||||
@ -42,7 +42,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccounts() {
|
||||
func(res *types.QueryAccountsResponse) {
|
||||
addresses := make([]sdk.AccAddress, len(res.Accounts))
|
||||
for i, acc := range res.Accounts {
|
||||
var account types.AccountI
|
||||
var account sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(acc, &account)
|
||||
suite.Require().NoError(err)
|
||||
addresses[i] = account.GetAddress()
|
||||
@ -123,7 +123,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() {
|
||||
},
|
||||
true,
|
||||
func(res *types.QueryAccountResponse) {
|
||||
var newAccount types.AccountI
|
||||
var newAccount sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Account, &newAccount)
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().NotNil(newAccount)
|
||||
@ -280,11 +280,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryModuleAccounts() {
|
||||
func(res *types.QueryModuleAccountsResponse) {
|
||||
mintModuleExists := false
|
||||
for _, acc := range res.Accounts {
|
||||
var account types.AccountI
|
||||
var account sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(acc, &account)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
moduleAccount, ok := account.(types.ModuleAccountI)
|
||||
moduleAccount, ok := account.(sdk.ModuleAccountI)
|
||||
|
||||
suite.Require().True(ok)
|
||||
if moduleAccount.GetName() == "mint" {
|
||||
@ -303,11 +303,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryModuleAccounts() {
|
||||
func(res *types.QueryModuleAccountsResponse) {
|
||||
mintModuleExists := false
|
||||
for _, acc := range res.Accounts {
|
||||
var account types.AccountI
|
||||
var account sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(acc, &account)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
moduleAccount, ok := account.(types.ModuleAccountI)
|
||||
moduleAccount, ok := account.(sdk.ModuleAccountI)
|
||||
|
||||
suite.Require().True(ok)
|
||||
if moduleAccount.GetName() == "falseCase" {
|
||||
@ -332,10 +332,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryModuleAccounts() {
|
||||
// Make sure output is sorted alphabetically.
|
||||
var moduleNames []string
|
||||
for _, any := range res.Accounts {
|
||||
var account types.AccountI
|
||||
var account sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(any, &account)
|
||||
suite.Require().NoError(err)
|
||||
moduleAccount, ok := account.(types.ModuleAccountI)
|
||||
moduleAccount, ok := account.(sdk.ModuleAccountI)
|
||||
suite.Require().True(ok)
|
||||
moduleNames = append(moduleNames, moduleAccount.GetName())
|
||||
}
|
||||
@ -366,11 +366,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryModuleAccountByName() {
|
||||
},
|
||||
true,
|
||||
func(res *types.QueryModuleAccountByNameResponse) {
|
||||
var account types.AccountI
|
||||
var account sdk.AccountI
|
||||
err := suite.encCfg.InterfaceRegistry.UnpackAny(res.Account, &account)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
moduleAccount, ok := account.(types.ModuleAccountI)
|
||||
moduleAccount, ok := account.(sdk.ModuleAccountI)
|
||||
suite.Require().True(ok)
|
||||
suite.Require().Equal(moduleAccount.GetName(), "mint")
|
||||
},
|
||||
|
||||
@ -18,25 +18,25 @@ import (
|
||||
// AccountKeeperI is the interface contract that x/auth's keeper implements.
|
||||
type AccountKeeperI interface {
|
||||
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
|
||||
NewAccountWithAddress(sdk.Context, sdk.AccAddress) types.AccountI
|
||||
NewAccountWithAddress(sdk.Context, sdk.AccAddress) sdk.AccountI
|
||||
|
||||
// Return a new account with the next account number. Does not save the new account to the store.
|
||||
NewAccount(sdk.Context, types.AccountI) types.AccountI
|
||||
NewAccount(sdk.Context, sdk.AccountI) sdk.AccountI
|
||||
|
||||
// Check if an account exists in the store.
|
||||
HasAccount(sdk.Context, sdk.AccAddress) bool
|
||||
|
||||
// Retrieve an account from the store.
|
||||
GetAccount(sdk.Context, sdk.AccAddress) types.AccountI
|
||||
GetAccount(sdk.Context, sdk.AccAddress) sdk.AccountI
|
||||
|
||||
// Set an account in the store.
|
||||
SetAccount(sdk.Context, types.AccountI)
|
||||
SetAccount(sdk.Context, sdk.AccountI)
|
||||
|
||||
// Remove an account from the store.
|
||||
RemoveAccount(sdk.Context, types.AccountI)
|
||||
RemoveAccount(sdk.Context, sdk.AccountI)
|
||||
|
||||
// Iterate over all accounts, calling the provided function. Stop iteration when it returns true.
|
||||
IterateAccounts(sdk.Context, func(types.AccountI) bool)
|
||||
IterateAccounts(sdk.Context, func(sdk.AccountI) bool)
|
||||
|
||||
// Fetch the public key of an account at a specified address
|
||||
GetPubKey(sdk.Context, sdk.AccAddress) (cryptotypes.PubKey, error)
|
||||
@ -59,7 +59,7 @@ type AccountKeeper struct {
|
||||
permAddrs map[string]types.PermissionsForAddress
|
||||
|
||||
// The prototypical AccountI constructor.
|
||||
proto func() types.AccountI
|
||||
proto func() sdk.AccountI
|
||||
addressCdc address.Codec
|
||||
|
||||
// the address capable of executing a MsgUpdateParams message. Typically, this
|
||||
@ -76,7 +76,7 @@ var _ AccountKeeperI = &AccountKeeper{}
|
||||
// and don't have to fit into any predefined structure. This auth module does not use account permissions internally, though other modules
|
||||
// may use auth.Keeper to access the accounts permissions map.
|
||||
func NewAccountKeeper(
|
||||
cdc codec.BinaryCodec, storeKey storetypes.StoreKey, proto func() types.AccountI,
|
||||
cdc codec.BinaryCodec, storeKey storetypes.StoreKey, proto func() sdk.AccountI,
|
||||
maccPerms map[string][]string, bech32Prefix string, authority string,
|
||||
) AccountKeeper {
|
||||
permAddrs := make(map[string]types.PermissionsForAddress)
|
||||
@ -160,7 +160,7 @@ func (ak AccountKeeper) GetModulePermissions() map[string]types.PermissionsForAd
|
||||
|
||||
// ValidatePermissions validates that the module account has been granted
|
||||
// permissions within its set of allowed permissions.
|
||||
func (ak AccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error {
|
||||
func (ak AccountKeeper) ValidatePermissions(macc sdk.ModuleAccountI) error {
|
||||
permAddr := ak.permAddrs[macc.GetName()]
|
||||
for _, perm := range macc.GetPermissions() {
|
||||
if !permAddr.HasPermission(perm) {
|
||||
@ -193,7 +193,7 @@ func (ak AccountKeeper) GetModuleAddressAndPermissions(moduleName string) (addr
|
||||
|
||||
// GetModuleAccountAndPermissions gets the module account from the auth account store and its
|
||||
// registered permissions
|
||||
func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string) {
|
||||
func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (sdk.ModuleAccountI, []string) {
|
||||
addr, perms := ak.GetModuleAddressAndPermissions(moduleName)
|
||||
if addr == nil {
|
||||
return nil, []string{}
|
||||
@ -201,7 +201,7 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa
|
||||
|
||||
acc := ak.GetAccount(ctx, addr)
|
||||
if acc != nil {
|
||||
macc, ok := acc.(types.ModuleAccountI)
|
||||
macc, ok := acc.(sdk.ModuleAccountI)
|
||||
if !ok {
|
||||
panic("account is not a module account")
|
||||
}
|
||||
@ -210,7 +210,7 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa
|
||||
|
||||
// create a new module account
|
||||
macc := types.NewEmptyModuleAccount(moduleName, perms...)
|
||||
maccI := (ak.NewAccount(ctx, macc)).(types.ModuleAccountI) // set the account number
|
||||
maccI := (ak.NewAccount(ctx, macc)).(sdk.ModuleAccountI) // set the account number
|
||||
ak.SetModuleAccount(ctx, maccI)
|
||||
|
||||
return maccI, perms
|
||||
@ -218,17 +218,17 @@ func (ak AccountKeeper) GetModuleAccountAndPermissions(ctx sdk.Context, moduleNa
|
||||
|
||||
// GetModuleAccount gets the module account from the auth account store, if the account does not
|
||||
// exist in the AccountKeeper, then it is created.
|
||||
func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI {
|
||||
func (ak AccountKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) sdk.ModuleAccountI {
|
||||
acc, _ := ak.GetModuleAccountAndPermissions(ctx, moduleName)
|
||||
return acc
|
||||
}
|
||||
|
||||
// SetModuleAccount sets the module account to the auth account store
|
||||
func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI) {
|
||||
func (ak AccountKeeper) SetModuleAccount(ctx sdk.Context, macc sdk.ModuleAccountI) {
|
||||
ak.SetAccount(ctx, macc)
|
||||
}
|
||||
|
||||
func (ak AccountKeeper) decodeAccount(bz []byte) types.AccountI {
|
||||
func (ak AccountKeeper) decodeAccount(bz []byte) sdk.AccountI {
|
||||
acc, err := ak.UnmarshalAccount(bz)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@ -238,14 +238,14 @@ func (ak AccountKeeper) decodeAccount(bz []byte) types.AccountI {
|
||||
}
|
||||
|
||||
// MarshalAccount protobuf serializes an Account interface
|
||||
func (ak AccountKeeper) MarshalAccount(accountI types.AccountI) ([]byte, error) { //nolint:interfacer
|
||||
func (ak AccountKeeper) MarshalAccount(accountI sdk.AccountI) ([]byte, error) { //nolint:interfacer
|
||||
return ak.cdc.MarshalInterface(accountI)
|
||||
}
|
||||
|
||||
// UnmarshalAccount returns an Account interface from raw encoded account
|
||||
// bytes of a Proto-based Account type
|
||||
func (ak AccountKeeper) UnmarshalAccount(bz []byte) (types.AccountI, error) {
|
||||
var acc types.AccountI
|
||||
func (ak AccountKeeper) UnmarshalAccount(bz []byte) (sdk.AccountI, error) {
|
||||
var acc sdk.AccountI
|
||||
return acc, ak.cdc.UnmarshalInterface(bz, &acc)
|
||||
}
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() {
|
||||
// Fix duplicate account numbers
|
||||
pubKey1 := ed25519.GenPrivKey().PubKey()
|
||||
pubKey2 := ed25519.GenPrivKey().PubKey()
|
||||
accts := []types.AccountI{
|
||||
accts := []sdk.AccountI{
|
||||
&types.BaseAccount{
|
||||
Address: sdk.AccAddress(pubKey1.Address()).String(),
|
||||
PubKey: codectypes.UnsafePackAny(pubKey1),
|
||||
@ -229,7 +229,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() {
|
||||
suite.Require().Equal(len(keeperAccts), len(accts)+1, "number of accounts in the keeper vs in genesis state")
|
||||
for i, genAcct := range accts {
|
||||
genAcctAddr := genAcct.GetAddress()
|
||||
var keeperAcct types.AccountI
|
||||
var keeperAcct sdk.AccountI
|
||||
for _, kacct := range keeperAccts {
|
||||
if genAcctAddr.Equals(kacct.GetAddress()) {
|
||||
keeperAcct = kacct
|
||||
|
||||
@ -27,7 +27,7 @@ func NewMigrator(keeper AccountKeeper, queryServer grpc.Server, ss exported.Subs
|
||||
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
|
||||
var iterErr error
|
||||
|
||||
m.keeper.IterateAccounts(ctx, func(account types.AccountI) (stop bool) {
|
||||
m.keeper.IterateAccounts(ctx, func(account sdk.AccountI) (stop bool) {
|
||||
wb, err := v2.MigrateAccount(ctx, account, m.queryServer)
|
||||
if err != nil {
|
||||
iterErr = err
|
||||
@ -63,7 +63,7 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error {
|
||||
// set the account without map to accAddr to accNumber.
|
||||
//
|
||||
// NOTE: This is used for testing purposes only.
|
||||
func (m Migrator) V45_SetAccount(ctx sdk.Context, acc types.AccountI) error { //nolint:revive
|
||||
func (m Migrator) V45_SetAccount(ctx sdk.Context, acc sdk.AccountI) error { //nolint:revive
|
||||
addr := acc.GetAddress()
|
||||
store := ctx.KVStore(m.keeper.storeKey)
|
||||
|
||||
|
||||
@ -30,7 +30,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
||||
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
@ -46,7 +45,7 @@ const (
|
||||
|
||||
// We use the baseapp.QueryRouter here to do inter-module state querying.
|
||||
// PLEASE DO NOT REPLICATE THIS PATTERN IN YOUR OWN APP.
|
||||
func migrateVestingAccounts(ctx sdk.Context, account types.AccountI, queryServer grpc.Server) (types.AccountI, error) {
|
||||
func migrateVestingAccounts(ctx sdk.Context, account sdk.AccountI, queryServer grpc.Server) (sdk.AccountI, error) {
|
||||
bondDenom, err := getBondDenom(ctx, queryServer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -100,7 +99,7 @@ func migrateVestingAccounts(ctx sdk.Context, account types.AccountI, queryServer
|
||||
|
||||
asVesting.TrackDelegation(ctx.BlockTime(), balance, delegations)
|
||||
|
||||
return asVesting.(types.AccountI), nil
|
||||
return asVesting.(sdk.AccountI), nil
|
||||
}
|
||||
|
||||
func resetVestingDelegatedBalances(evacct exported.VestingAccount) (exported.VestingAccount, bool) {
|
||||
@ -290,6 +289,6 @@ func getBondDenom(ctx sdk.Context, queryServer grpc.Server) (string, error) {
|
||||
//
|
||||
// We use the baseapp.QueryRouter here to do inter-module state querying.
|
||||
// PLEASE DO NOT REPLICATE THIS PATTERN IN YOUR OWN APP.
|
||||
func MigrateAccount(ctx sdk.Context, account types.AccountI, queryServer grpc.Server) (types.AccountI, error) {
|
||||
func MigrateAccount(ctx sdk.Context, account sdk.AccountI, queryServer grpc.Server) (sdk.AccountI, error) {
|
||||
return migrateVestingAccounts(ctx, account, queryServer)
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ func mapAccountAddressToAccountID(ctx sdk.Context, storeKey storetypes.StoreKey,
|
||||
|
||||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var acc types.AccountI
|
||||
var acc sdk.AccountI
|
||||
if err := cdc.UnmarshalInterface(iterator.Value(), &acc); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ type AuthInputs struct {
|
||||
Cdc codec.Codec
|
||||
|
||||
RandomGenesisAccountsFn types.RandomGenesisAccountsFn `optional:"true"`
|
||||
AccountI func() types.AccountI `optional:"true"`
|
||||
AccountI func() sdk.AccountI `optional:"true"`
|
||||
|
||||
// LegacySubspace is used solely for migration of x/params managed parameters
|
||||
LegacySubspace exported.Subspace `optional:"true"`
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
type AuthUnmarshaler interface {
|
||||
UnmarshalAccount([]byte) (types.AccountI, error)
|
||||
UnmarshalAccount([]byte) (sdk.AccountI, error)
|
||||
GetCodec() codec.BinaryCodec
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
@ -7,7 +7,6 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
@ -16,11 +15,11 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
_ AccountI = (*BaseAccount)(nil)
|
||||
_ sdk.AccountI = (*BaseAccount)(nil)
|
||||
_ GenesisAccount = (*BaseAccount)(nil)
|
||||
_ codectypes.UnpackInterfacesMessage = (*BaseAccount)(nil)
|
||||
_ GenesisAccount = (*ModuleAccount)(nil)
|
||||
_ ModuleAccountI = (*ModuleAccount)(nil)
|
||||
_ sdk.ModuleAccountI = (*ModuleAccount)(nil)
|
||||
)
|
||||
|
||||
// NewBaseAccount creates a new BaseAccount object
|
||||
@ -42,7 +41,7 @@ func NewBaseAccount(address sdk.AccAddress, pubKey cryptotypes.PubKey, accountNu
|
||||
}
|
||||
|
||||
// ProtoBaseAccount - a prototype function for BaseAccount
|
||||
func ProtoBaseAccount() AccountI {
|
||||
func ProtoBaseAccount() sdk.AccountI {
|
||||
return &BaseAccount{}
|
||||
}
|
||||
|
||||
@ -273,33 +272,18 @@ func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error {
|
||||
// and a pubkey for authentication purposes.
|
||||
//
|
||||
// Many complex conditions can be used in the concrete struct which implements AccountI.
|
||||
//
|
||||
// Deprecated: Use `AccountI` from types package instead.
|
||||
type AccountI interface {
|
||||
proto.Message
|
||||
|
||||
GetAddress() sdk.AccAddress
|
||||
SetAddress(sdk.AccAddress) error // errors if already set.
|
||||
|
||||
GetPubKey() cryptotypes.PubKey // can return nil.
|
||||
SetPubKey(cryptotypes.PubKey) error
|
||||
|
||||
GetAccountNumber() uint64
|
||||
SetAccountNumber(uint64) error
|
||||
|
||||
GetSequence() uint64
|
||||
SetSequence(uint64) error
|
||||
|
||||
// Ensure that account implements stringer
|
||||
String() string
|
||||
sdk.AccountI
|
||||
}
|
||||
|
||||
// ModuleAccountI defines an account interface for modules that hold tokens in
|
||||
// an escrow.
|
||||
//
|
||||
// Deprecated: Use `ModuleAccountI` from types package instead.
|
||||
type ModuleAccountI interface {
|
||||
AccountI
|
||||
|
||||
GetName() string
|
||||
GetPermissions() []string
|
||||
HasPermission(string) bool
|
||||
sdk.ModuleAccountI
|
||||
}
|
||||
|
||||
// GenesisAccounts defines a slice of GenesisAccount objects
|
||||
@ -319,7 +303,7 @@ func (ga GenesisAccounts) Contains(addr sdk.Address) bool {
|
||||
|
||||
// GenesisAccount defines a genesis account that embeds an AccountI with validation capabilities.
|
||||
type GenesisAccount interface {
|
||||
AccountI
|
||||
sdk.AccountI
|
||||
|
||||
Validate() error
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
_ client.Account = AccountI(nil)
|
||||
_ client.Account = sdk.AccountI(nil)
|
||||
_ client.AccountRetriever = AccountRetriever{}
|
||||
)
|
||||
|
||||
@ -51,7 +51,7 @@ func (ar AccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr s
|
||||
return nil, 0, fmt.Errorf("failed to parse block height: %w", err)
|
||||
}
|
||||
|
||||
var acc AccountI
|
||||
var acc sdk.AccountI
|
||||
if err := clientCtx.InterfaceRegistry.UnpackAny(res.Account, &acc); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
@ -16,9 +16,9 @@ import (
|
||||
// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the
|
||||
// provided LegacyAmino codec. These types are used for Amino JSON serialization
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
cdc.RegisterInterface((*ModuleAccountI)(nil), nil)
|
||||
cdc.RegisterInterface((*sdk.ModuleAccountI)(nil), nil)
|
||||
cdc.RegisterInterface((*GenesisAccount)(nil), nil)
|
||||
cdc.RegisterInterface((*AccountI)(nil), nil)
|
||||
cdc.RegisterInterface((*sdk.AccountI)(nil), nil)
|
||||
cdc.RegisterConcrete(&BaseAccount{}, "cosmos-sdk/BaseAccount", nil)
|
||||
cdc.RegisterConcrete(&ModuleAccount{}, "cosmos-sdk/ModuleAccount", nil)
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/auth/Params", nil)
|
||||
@ -39,6 +39,13 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
&ModuleAccount{},
|
||||
)
|
||||
|
||||
registry.RegisterInterface(
|
||||
"cosmos.auth.v1beta1.AccountI",
|
||||
(*sdk.AccountI)(nil),
|
||||
&BaseAccount{},
|
||||
&ModuleAccount{},
|
||||
)
|
||||
|
||||
registry.RegisterInterface(
|
||||
"cosmos.auth.v1beta1.GenesisAccount",
|
||||
(*GenesisAccount)(nil),
|
||||
|
||||
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
)
|
||||
|
||||
@ -148,10 +149,10 @@ type GenesisAccountIterator struct{}
|
||||
// appGenesis and invokes a callback on each genesis account. If any call
|
||||
// returns true, iteration stops.
|
||||
func (GenesisAccountIterator) IterateGenesisAccounts(
|
||||
cdc codec.Codec, appGenesis map[string]json.RawMessage, cb func(AccountI) (stop bool),
|
||||
cdc codec.Codec, appGenesis map[string]json.RawMessage, cb func(sdk.AccountI) (stop bool),
|
||||
) {
|
||||
for _, genAcc := range GetGenesisStateFromAppState(cdc, appGenesis).Accounts {
|
||||
acc, ok := genAcc.GetCachedValue().(AccountI)
|
||||
acc, ok := genAcc.GetCachedValue().(sdk.AccountI)
|
||||
if !ok {
|
||||
panic("expected account")
|
||||
}
|
||||
|
||||
@ -5,10 +5,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
proto "github.com/cosmos/gogoproto/proto"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@ -75,7 +75,7 @@ func TestGenesisAccountIterator(t *testing.T) {
|
||||
|
||||
var addresses []sdk.AccAddress
|
||||
types.GenesisAccountIterator{}.IterateGenesisAccounts(
|
||||
cdc, appGenesis, func(acc types.AccountI) (stop bool) {
|
||||
cdc, appGenesis, func(acc sdk.AccountI) (stop bool) {
|
||||
addresses = append(addresses, acc.GetAddress())
|
||||
return false
|
||||
},
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package types
|
||||
|
||||
import codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
import (
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
func (m *QueryAccountResponse) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
|
||||
var account AccountI
|
||||
var account sdk.AccountI
|
||||
return unpacker.UnpackAny(m.Account, &account)
|
||||
}
|
||||
|
||||
|
||||
@ -3,14 +3,12 @@ package exported
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// VestingAccount defines an account type that vests coins via a vesting schedule.
|
||||
type VestingAccount interface {
|
||||
types.AccountI
|
||||
sdk.AccountI
|
||||
|
||||
// LockedCoins returns the set of coins that are not spendable (i.e. locked),
|
||||
// defined as the vesting coins that are not delegated.
|
||||
|
||||
@ -56,7 +56,7 @@ func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCre
|
||||
baseAccount = ak.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount)
|
||||
baseVestingAccount := types.NewBaseVestingAccount(baseAccount, msg.Amount.Sort(), msg.EndTime)
|
||||
|
||||
var vestingAccount authtypes.AccountI
|
||||
var vestingAccount sdk.AccountI
|
||||
if msg.Delayed {
|
||||
vestingAccount = types.NewDelayedVestingAccountRaw(baseVestingAccount)
|
||||
} else {
|
||||
|
||||
@ -41,7 +41,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
)
|
||||
|
||||
registry.RegisterImplementations(
|
||||
(*authtypes.AccountI)(nil),
|
||||
(*sdk.AccountI)(nil),
|
||||
&BaseVestingAccount{},
|
||||
&DelayedVestingAccount{},
|
||||
&ContinuousVestingAccount{},
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
|
||||
// Compile-time type assertions
|
||||
var (
|
||||
_ authtypes.AccountI = (*BaseVestingAccount)(nil)
|
||||
_ sdk.AccountI = (*BaseVestingAccount)(nil)
|
||||
_ vestexported.VestingAccount = (*ContinuousVestingAccount)(nil)
|
||||
_ vestexported.VestingAccount = (*PeriodicVestingAccount)(nil)
|
||||
_ vestexported.VestingAccount = (*DelayedVestingAccount)(nil)
|
||||
|
||||
@ -2,14 +2,13 @@ package authz
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// AccountKeeper defines the expected account keeper (noalias)
|
||||
type AccountKeeper interface {
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
|
||||
SetAccount(ctx sdk.Context, acc authtypes.AccountI)
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
SetAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -8,7 +8,6 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -36,10 +35,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -50,10 +49,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// NewAccountWithAddress mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -64,7 +63,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interfa
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/internal/conv"
|
||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||
|
||||
@ -149,7 +149,7 @@ func (suite *KeeperTestSuite) mockSendCoinsFromAccountToModule(acc *authtypes.Ba
|
||||
suite.authKeeper.EXPECT().HasAccount(suite.ctx, moduleAcc.GetAddress()).Return(true)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockSendCoins(ctx sdk.Context, sender authtypes.AccountI, receiver sdk.AccAddress) {
|
||||
func (suite *KeeperTestSuite) mockSendCoins(ctx sdk.Context, sender sdk.AccountI, receiver sdk.AccAddress) {
|
||||
suite.authKeeper.EXPECT().GetAccount(ctx, sender.GetAddress()).Return(sender)
|
||||
suite.authKeeper.EXPECT().HasAccount(ctx, receiver).Return(true)
|
||||
}
|
||||
@ -159,7 +159,7 @@ func (suite *KeeperTestSuite) mockFundAccount(receiver sdk.AccAddress) {
|
||||
suite.mockSendCoinsFromModuleToAccount(mintAcc, receiver)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockInputOutputCoins(inputs []authtypes.AccountI, outputs []sdk.AccAddress) {
|
||||
func (suite *KeeperTestSuite) mockInputOutputCoins(inputs []sdk.AccountI, outputs []sdk.AccAddress) {
|
||||
for _, input := range inputs {
|
||||
suite.authKeeper.EXPECT().GetAccount(suite.ctx, input.GetAddress()).Return(input)
|
||||
}
|
||||
@ -168,15 +168,15 @@ func (suite *KeeperTestSuite) mockInputOutputCoins(inputs []authtypes.AccountI,
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockValidateBalance(acc authtypes.AccountI) {
|
||||
func (suite *KeeperTestSuite) mockValidateBalance(acc sdk.AccountI) {
|
||||
suite.authKeeper.EXPECT().GetAccount(suite.ctx, acc.GetAddress()).Return(acc)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockSpendableCoins(ctx sdk.Context, acc authtypes.AccountI) {
|
||||
func (suite *KeeperTestSuite) mockSpendableCoins(ctx sdk.Context, acc sdk.AccountI) {
|
||||
suite.authKeeper.EXPECT().GetAccount(ctx, acc.GetAddress()).Return(acc)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockDelegateCoins(ctx sdk.Context, acc authtypes.AccountI, mAcc authtypes.AccountI) {
|
||||
func (suite *KeeperTestSuite) mockDelegateCoins(ctx sdk.Context, acc sdk.AccountI, mAcc sdk.AccountI) {
|
||||
vacc, ok := acc.(banktypes.VestingAccount)
|
||||
if ok {
|
||||
suite.authKeeper.EXPECT().SetAccount(ctx, vacc)
|
||||
@ -185,7 +185,7 @@ func (suite *KeeperTestSuite) mockDelegateCoins(ctx sdk.Context, acc authtypes.A
|
||||
suite.authKeeper.EXPECT().GetAccount(ctx, mAcc.GetAddress()).Return(mAcc)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) mockUnDelegateCoins(ctx sdk.Context, acc authtypes.AccountI, mAcc authtypes.AccountI) {
|
||||
func (suite *KeeperTestSuite) mockUnDelegateCoins(ctx sdk.Context, acc sdk.AccountI, mAcc sdk.AccountI) {
|
||||
vacc, ok := acc.(banktypes.VestingAccount)
|
||||
if ok {
|
||||
suite.authKeeper.EXPECT().SetAccount(ctx, vacc)
|
||||
@ -466,7 +466,7 @@ func (suite *KeeperTestSuite) TestInputOutputNewAccount() {
|
||||
|
||||
require.Empty(suite.bankKeeper.GetAllBalances(ctx, accAddrs[1]))
|
||||
|
||||
suite.mockInputOutputCoins([]authtypes.AccountI{authtypes.NewBaseAccountWithAddress(accAddrs[0])}, []sdk.AccAddress{accAddrs[1]})
|
||||
suite.mockInputOutputCoins([]sdk.AccountI{authtypes.NewBaseAccountWithAddress(accAddrs[0])}, []sdk.AccAddress{accAddrs[1]})
|
||||
inputs := []banktypes.Input{
|
||||
{Address: accAddrs[0].String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))},
|
||||
}
|
||||
@ -516,7 +516,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoins() {
|
||||
|
||||
require.Error(suite.bankKeeper.InputOutputCoins(ctx, insufficientInputs, insufficientOutputs))
|
||||
|
||||
suite.mockInputOutputCoins([]authtypes.AccountI{acc0}, accAddrs[1:3])
|
||||
suite.mockInputOutputCoins([]sdk.AccountI{acc0}, accAddrs[1:3])
|
||||
require.NoError(suite.bankKeeper.InputOutputCoins(ctx, inputs, outputs))
|
||||
|
||||
acc1Balances := suite.bankKeeper.GetAllBalances(ctx, accAddrs[0])
|
||||
@ -746,7 +746,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
|
||||
suite.mockFundAccount(accAddrs[0])
|
||||
require.NoError(banktestutil.FundAccount(suite.bankKeeper, ctx, accAddrs[0], sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50), sdk.NewInt64Coin(barDenom, 100))))
|
||||
|
||||
suite.mockInputOutputCoins([]authtypes.AccountI{acc0}, accAddrs[2:4])
|
||||
suite.mockInputOutputCoins([]sdk.AccountI{acc0}, accAddrs[2:4])
|
||||
require.NoError(suite.bankKeeper.InputOutputCoins(ctx, inputs, outputs))
|
||||
|
||||
events = ctx.EventManager().ABCIEvents()
|
||||
@ -771,7 +771,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
|
||||
require.NoError(banktestutil.FundAccount(suite.bankKeeper, ctx, accAddrs[0], sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100))))
|
||||
newCoins2 = sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100))
|
||||
|
||||
suite.mockInputOutputCoins([]authtypes.AccountI{acc0}, accAddrs[2:4])
|
||||
suite.mockInputOutputCoins([]sdk.AccountI{acc0}, accAddrs[2:4])
|
||||
require.NoError(suite.bankKeeper.InputOutputCoins(ctx, inputs, outputs))
|
||||
|
||||
events = ctx.EventManager().ABCIEvents()
|
||||
|
||||
@ -2,7 +2,6 @@ package keeper_test
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
)
|
||||
|
||||
@ -159,7 +158,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() {
|
||||
suite.mockMintCoins(minterAcc)
|
||||
suite.bankKeeper.MintCoins(suite.ctx, minterAcc.Name, origCoins)
|
||||
if !tc.expErr {
|
||||
suite.mockInputOutputCoins([]authtypes.AccountI{minterAcc}, accAddrs[:2])
|
||||
suite.mockInputOutputCoins([]sdk.AccountI{minterAcc}, accAddrs[:2])
|
||||
}
|
||||
_, err := suite.msgServer.MultiSend(suite.ctx, tc.input)
|
||||
if tc.expErr {
|
||||
|
||||
@ -36,10 +36,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -50,10 +50,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetAllAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllAccounts", ctx)
|
||||
ret0, _ := ret[0].([]types0.AccountI)
|
||||
ret0, _ := ret[0].([]types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -64,10 +64,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAllAccounts(ctx interface{}) *gomock
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -78,10 +78,10 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interf
|
||||
}
|
||||
|
||||
// GetModuleAccountAndPermissions mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx types.Context, moduleName string) (types0.ModuleAccountI, []string) {
|
||||
func (m *MockAccountKeeper) GetModuleAccountAndPermissions(ctx types.Context, moduleName string) (types.ModuleAccountI, []string) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccountAndPermissions", ctx, moduleName)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
ret1, _ := ret[1].([]string)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -150,7 +150,7 @@ func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, process)
|
||||
}
|
||||
@ -162,10 +162,10 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{
|
||||
}
|
||||
|
||||
// NewAccount mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types0.AccountI) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccount", arg0, arg1)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -176,10 +176,10 @@ func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// NewAccountWithAddress mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interfa
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
@ -202,7 +202,7 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc
|
||||
}
|
||||
|
||||
// SetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetModuleAccount(ctx types.Context, macc types0.ModuleAccountI) {
|
||||
func (m *MockAccountKeeper) SetModuleAccount(ctx types.Context, macc types.ModuleAccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetModuleAccount", ctx, macc)
|
||||
}
|
||||
@ -214,7 +214,7 @@ func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(ctx, macc interface{})
|
||||
}
|
||||
|
||||
// ValidatePermissions mocks base method.
|
||||
func (m *MockAccountKeeper) ValidatePermissions(macc types0.ModuleAccountI) error {
|
||||
func (m *MockAccountKeeper) ValidatePermissions(macc types.ModuleAccountI) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatePermissions", macc)
|
||||
ret0, _ := ret[0].(error)
|
||||
|
||||
@ -8,22 +8,22 @@ import (
|
||||
// AccountKeeper defines the account contract that must be fulfilled when
|
||||
// creating a x/bank keeper.
|
||||
type AccountKeeper interface {
|
||||
NewAccount(sdk.Context, types.AccountI) types.AccountI
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
NewAccount(sdk.Context, sdk.AccountI) sdk.AccountI
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
GetAllAccounts(ctx sdk.Context) []types.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
GetAllAccounts(ctx sdk.Context) []sdk.AccountI
|
||||
HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
|
||||
SetAccount(ctx sdk.Context, acc types.AccountI)
|
||||
SetAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
|
||||
IterateAccounts(ctx sdk.Context, process func(types.AccountI) bool)
|
||||
IterateAccounts(ctx sdk.Context, process func(sdk.AccountI) bool)
|
||||
|
||||
ValidatePermissions(macc types.ModuleAccountI) error
|
||||
ValidatePermissions(macc sdk.ModuleAccountI) error
|
||||
|
||||
GetModuleAddress(moduleName string) sdk.AccAddress
|
||||
GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
|
||||
GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string)
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
|
||||
SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI)
|
||||
GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (sdk.ModuleAccountI, []string)
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) sdk.ModuleAccountI
|
||||
SetModuleAccount(ctx sdk.Context, macc sdk.ModuleAccountI)
|
||||
GetModulePermissions() map[string]types.PermissionsForAddress
|
||||
}
|
||||
|
||||
@ -36,10 +36,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -50,10 +50,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetAllAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAllAccounts(ctx types.Context) []types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllAccounts", ctx)
|
||||
ret0, _ := ret[0].([]types0.AccountI)
|
||||
ret0, _ := ret[0].([]types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ func (mr *MockAccountKeeperMockRecorder) HasAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, process)
|
||||
}
|
||||
@ -162,10 +162,10 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{
|
||||
}
|
||||
|
||||
// NewAccount mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types0.AccountI) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccount", arg0, arg1)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -176,10 +176,10 @@ func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// NewAccountWithAddress mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interfa
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package keeper
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
||||
)
|
||||
|
||||
@ -17,6 +16,6 @@ func (k Keeper) GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins {
|
||||
}
|
||||
|
||||
// GetDistributionAccount returns the distribution ModuleAccount
|
||||
func (k Keeper) GetDistributionAccount(ctx sdk.Context) authtypes.ModuleAccountI {
|
||||
func (k Keeper) GetDistributionAccount(ctx sdk.Context) sdk.ModuleAccountI {
|
||||
return k.authKeeper.GetModuleAccount(ctx, types.ModuleName)
|
||||
}
|
||||
|
||||
@ -8,8 +8,7 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -37,10 +36,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -51,10 +50,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, name string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, name string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, name)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -79,7 +78,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom
|
||||
}
|
||||
|
||||
// SetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) {
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types.ModuleAccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetModuleAccount", arg0, arg1)
|
||||
}
|
||||
@ -221,10 +220,10 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// Delegation mocks base method.
|
||||
func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types1.DelegationI {
|
||||
func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types0.DelegationI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(types1.DelegationI)
|
||||
ret0, _ := ret[0].(types0.DelegationI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -235,10 +234,10 @@ func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 interface{}
|
||||
}
|
||||
|
||||
// GetAllDelegatorDelegations mocks base method.
|
||||
func (m *MockStakingKeeper) GetAllDelegatorDelegations(ctx types.Context, delegator types.AccAddress) []types1.Delegation {
|
||||
func (m *MockStakingKeeper) GetAllDelegatorDelegations(ctx types.Context, delegator types.AccAddress) []types0.Delegation {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllDelegatorDelegations", ctx, delegator)
|
||||
ret0, _ := ret[0].([]types1.Delegation)
|
||||
ret0, _ := ret[0].([]types0.Delegation)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -249,10 +248,10 @@ func (mr *MockStakingKeeperMockRecorder) GetAllDelegatorDelegations(ctx, delegat
|
||||
}
|
||||
|
||||
// GetAllSDKDelegations mocks base method.
|
||||
func (m *MockStakingKeeper) GetAllSDKDelegations(ctx types.Context) []types1.Delegation {
|
||||
func (m *MockStakingKeeper) GetAllSDKDelegations(ctx types.Context) []types0.Delegation {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllSDKDelegations", ctx)
|
||||
ret0, _ := ret[0].([]types1.Delegation)
|
||||
ret0, _ := ret[0].([]types0.Delegation)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -263,10 +262,10 @@ func (mr *MockStakingKeeperMockRecorder) GetAllSDKDelegations(ctx interface{}) *
|
||||
}
|
||||
|
||||
// GetAllValidators mocks base method.
|
||||
func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types1.Validator {
|
||||
func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types0.Validator {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllValidators", ctx)
|
||||
ret0, _ := ret[0].([]types1.Validator)
|
||||
ret0, _ := ret[0].([]types0.Validator)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -277,7 +276,7 @@ func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx interface{}) *gomo
|
||||
}
|
||||
|
||||
// IterateDelegations mocks base method.
|
||||
func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) {
|
||||
func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn)
|
||||
}
|
||||
@ -289,7 +288,7 @@ func (mr *MockStakingKeeperMockRecorder) IterateDelegations(ctx, delegator, fn i
|
||||
}
|
||||
|
||||
// IterateValidators mocks base method.
|
||||
func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateValidators", arg0, arg1)
|
||||
}
|
||||
@ -301,10 +300,10 @@ func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 interface{
|
||||
}
|
||||
|
||||
// Validator mocks base method.
|
||||
func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types1.ValidatorI {
|
||||
func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types0.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Validator", arg0, arg1)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
ret0, _ := ret[0].(types0.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -315,10 +314,10 @@ func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 interface{}) *gomo
|
||||
}
|
||||
|
||||
// ValidatorByConsAddr mocks base method.
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types1.ValidatorI {
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types0.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
ret0, _ := ret[0].(types0.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
|
||||
@ -2,19 +2,18 @@ package types
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
// AccountKeeper defines the expected account keeper used for simulations (noalias)
|
||||
type AccountKeeper interface {
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
|
||||
GetModuleAddress(name string) sdk.AccAddress
|
||||
GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI
|
||||
GetModuleAccount(ctx sdk.Context, name string) sdk.ModuleAccountI
|
||||
|
||||
// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
|
||||
SetModuleAccount(sdk.Context, types.ModuleAccountI)
|
||||
SetModuleAccount(sdk.Context, sdk.ModuleAccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -10,8 +10,7 @@ import (
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
types2 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -39,10 +38,10 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetParams mocks base method.
|
||||
func (m *MockStakingKeeper) GetParams(ctx types0.Context) types2.Params {
|
||||
func (m *MockStakingKeeper) GetParams(ctx types0.Context) types1.Params {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetParams", ctx)
|
||||
ret0, _ := ret[0].(types2.Params)
|
||||
ret0, _ := ret[0].(types1.Params)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -53,10 +52,10 @@ func (mr *MockStakingKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call
|
||||
}
|
||||
|
||||
// ValidatorByConsAddr mocks base method.
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types0.Context, arg1 types0.ConsAddress) types2.ValidatorI {
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types0.Context, arg1 types0.ConsAddress) types1.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1)
|
||||
ret0, _ := ret[0].(types2.ValidatorI)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -183,7 +182,7 @@ func (mr *MockSlashingKeeperMockRecorder) SlashFractionDoubleSign(arg0 interface
|
||||
}
|
||||
|
||||
// SlashWithInfractionReason mocks base method.
|
||||
func (m *MockSlashingKeeper) SlashWithInfractionReason(arg0 types0.Context, arg1 types0.ConsAddress, arg2 types0.Dec, arg3, arg4 int64, arg5 types2.Infraction) {
|
||||
func (m *MockSlashingKeeper) SlashWithInfractionReason(arg0 types0.Context, arg1 types0.ConsAddress, arg2 types0.Dec, arg3, arg4 int64, arg5 types1.Infraction) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5)
|
||||
}
|
||||
@ -230,7 +229,7 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types0.Context, acc types1.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types0.Context, acc types0.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package types
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
@ -34,7 +32,7 @@ type (
|
||||
|
||||
// AccountKeeper define the account keeper interface contracted needed by the evidence module
|
||||
AccountKeeper interface {
|
||||
SetAccount(ctx sdk.Context, acc types.AccountI)
|
||||
SetAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
}
|
||||
|
||||
// BankKeeper define the account keeper interface contracted needed by the evidence module
|
||||
|
||||
@ -2,17 +2,16 @@ package feegrant
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// AccountKeeper defines the expected auth Account Keeper (noalias)
|
||||
type AccountKeeper interface {
|
||||
GetModuleAddress(moduleName string) sdk.AccAddress
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) auth.ModuleAccountI
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) sdk.ModuleAccountI
|
||||
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
|
||||
SetAccount(ctx sdk.Context, acc auth.AccountI)
|
||||
NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
SetAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected supply Keeper (noalias)
|
||||
|
||||
@ -8,7 +8,6 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -36,10 +35,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -50,10 +49,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -78,10 +77,10 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(moduleName interface{}
|
||||
}
|
||||
|
||||
// NewAccountWithAddress mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccountWithAddress(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -92,7 +91,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interfa
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", ctx, acc)
|
||||
}
|
||||
|
||||
@ -10,10 +10,9 @@ import (
|
||||
|
||||
codec "github.com/cosmos/cosmos-sdk/codec"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
exported "github.com/cosmos/cosmos-sdk/x/bank/exported"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
types1 "github.com/tendermint/tendermint/abci/types"
|
||||
types0 "github.com/tendermint/tendermint/abci/types"
|
||||
)
|
||||
|
||||
// MockStakingKeeper is a mock of StakingKeeper interface.
|
||||
@ -40,10 +39,10 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// ApplyAndReturnValidatorSetUpdates mocks base method.
|
||||
func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types.Context) ([]types1.ValidatorUpdate, error) {
|
||||
func (m *MockStakingKeeper) ApplyAndReturnValidatorSetUpdates(arg0 types.Context) ([]types0.ValidatorUpdate, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ApplyAndReturnValidatorSetUpdates", arg0)
|
||||
ret0, _ := ret[0].([]types1.ValidatorUpdate)
|
||||
ret0, _ := ret[0].([]types0.ValidatorUpdate)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -78,7 +77,7 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, process)
|
||||
}
|
||||
@ -90,10 +89,10 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{
|
||||
}
|
||||
|
||||
// NewAccount mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types0.AccountI) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccount", arg0, arg1)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -104,7 +103,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(arg0 types.Context, arg1 types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(arg0 types.Context, arg1 types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", arg0, arg1)
|
||||
}
|
||||
@ -139,7 +138,7 @@ func (m *MockGenesisAccountsIterator) EXPECT() *MockGenesisAccountsIteratorMockR
|
||||
}
|
||||
|
||||
// IterateGenesisAccounts mocks base method.
|
||||
func (m *MockGenesisAccountsIterator) IterateGenesisAccounts(cdc *codec.LegacyAmino, appGenesis map[string]json.RawMessage, cb func(types0.AccountI) bool) {
|
||||
func (m *MockGenesisAccountsIterator) IterateGenesisAccounts(cdc *codec.LegacyAmino, appGenesis map[string]json.RawMessage, cb func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateGenesisAccounts", cdc, appGenesis, cb)
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankexported "github.com/cosmos/cosmos-sdk/x/bank/exported"
|
||||
)
|
||||
|
||||
@ -18,9 +17,9 @@ type StakingKeeper interface {
|
||||
|
||||
// AccountKeeper defines the expected account keeper (noalias)
|
||||
type AccountKeeper interface {
|
||||
NewAccount(sdk.Context, auth.AccountI) auth.AccountI
|
||||
SetAccount(sdk.Context, auth.AccountI)
|
||||
IterateAccounts(ctx sdk.Context, process func(auth.AccountI) (stop bool))
|
||||
NewAccount(sdk.Context, sdk.AccountI) sdk.AccountI
|
||||
SetAccount(sdk.Context, sdk.AccountI)
|
||||
IterateAccounts(ctx sdk.Context, process func(sdk.AccountI) (stop bool))
|
||||
}
|
||||
|
||||
// GenesisAccountsIterator defines the expected iterating genesis accounts object (noalias)
|
||||
@ -28,7 +27,7 @@ type GenesisAccountsIterator interface {
|
||||
IterateGenesisAccounts(
|
||||
cdc *codec.LegacyAmino,
|
||||
appGenesis map[string]json.RawMessage,
|
||||
cb func(auth.AccountI) (stop bool),
|
||||
cb func(sdk.AccountI) (stop bool),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
@ -135,7 +134,7 @@ func (k Keeper) LegacyRouter() v1beta1.Router {
|
||||
}
|
||||
|
||||
// GetGovernanceAccount returns the governance ModuleAccount
|
||||
func (k Keeper) GetGovernanceAccount(ctx sdk.Context) authtypes.ModuleAccountI {
|
||||
func (k Keeper) GetGovernanceAccount(ctx sdk.Context) sdk.ModuleAccountI {
|
||||
return k.authKeeper.GetModuleAccount(ctx, types.ModuleName)
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ import (
|
||||
math "cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
)
|
||||
@ -16,7 +15,7 @@ import (
|
||||
type AccountKeeper interface {
|
||||
types.AccountKeeper
|
||||
|
||||
IterateAccounts(ctx sdk.Context, cb func(account authtypes.AccountI) (stop bool))
|
||||
IterateAccounts(ctx sdk.Context, cb func(account sdk.AccountI) (stop bool))
|
||||
}
|
||||
|
||||
// BankKeeper extends gov's actual expected BankKeeper with additional
|
||||
|
||||
@ -11,10 +11,9 @@ import (
|
||||
math "cosmossdk.io/math"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
query "github.com/cosmos/cosmos-sdk/types/query"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
keeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
types2 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -42,10 +41,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -56,10 +55,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, name string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, name string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, name)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -84,7 +83,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, cb func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, cb func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, cb)
|
||||
}
|
||||
@ -96,7 +95,7 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, cb interface{}) *g
|
||||
}
|
||||
|
||||
// SetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) {
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types.ModuleAccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetModuleAccount", arg0, arg1)
|
||||
}
|
||||
@ -131,10 +130,10 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// AllBalances mocks base method.
|
||||
func (m *MockBankKeeper) AllBalances(arg0 context.Context, arg1 *types1.QueryAllBalancesRequest) (*types1.QueryAllBalancesResponse, error) {
|
||||
func (m *MockBankKeeper) AllBalances(arg0 context.Context, arg1 *types0.QueryAllBalancesRequest) (*types0.QueryAllBalancesResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "AllBalances", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryAllBalancesResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryAllBalancesResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -146,10 +145,10 @@ func (mr *MockBankKeeperMockRecorder) AllBalances(arg0, arg1 interface{}) *gomoc
|
||||
}
|
||||
|
||||
// Balance mocks base method.
|
||||
func (m *MockBankKeeper) Balance(arg0 context.Context, arg1 *types1.QueryBalanceRequest) (*types1.QueryBalanceResponse, error) {
|
||||
func (m *MockBankKeeper) Balance(arg0 context.Context, arg1 *types0.QueryBalanceRequest) (*types0.QueryBalanceResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Balance", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryBalanceResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryBalanceResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -234,10 +233,10 @@ func (mr *MockBankKeeperMockRecorder) DeleteSendEnabled(ctx interface{}, denoms
|
||||
}
|
||||
|
||||
// DenomMetadata mocks base method.
|
||||
func (m *MockBankKeeper) DenomMetadata(arg0 context.Context, arg1 *types1.QueryDenomMetadataRequest) (*types1.QueryDenomMetadataResponse, error) {
|
||||
func (m *MockBankKeeper) DenomMetadata(arg0 context.Context, arg1 *types0.QueryDenomMetadataRequest) (*types0.QueryDenomMetadataResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DenomMetadata", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryDenomMetadataResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryDenomMetadataResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -249,10 +248,10 @@ func (mr *MockBankKeeperMockRecorder) DenomMetadata(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// DenomOwners mocks base method.
|
||||
func (m *MockBankKeeper) DenomOwners(arg0 context.Context, arg1 *types1.QueryDenomOwnersRequest) (*types1.QueryDenomOwnersResponse, error) {
|
||||
func (m *MockBankKeeper) DenomOwners(arg0 context.Context, arg1 *types0.QueryDenomOwnersRequest) (*types0.QueryDenomOwnersResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DenomOwners", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryDenomOwnersResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryDenomOwnersResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -264,10 +263,10 @@ func (mr *MockBankKeeperMockRecorder) DenomOwners(arg0, arg1 interface{}) *gomoc
|
||||
}
|
||||
|
||||
// DenomsMetadata mocks base method.
|
||||
func (m *MockBankKeeper) DenomsMetadata(arg0 context.Context, arg1 *types1.QueryDenomsMetadataRequest) (*types1.QueryDenomsMetadataResponse, error) {
|
||||
func (m *MockBankKeeper) DenomsMetadata(arg0 context.Context, arg1 *types0.QueryDenomsMetadataRequest) (*types0.QueryDenomsMetadataResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "DenomsMetadata", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryDenomsMetadataResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryDenomsMetadataResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -279,10 +278,10 @@ func (mr *MockBankKeeperMockRecorder) DenomsMetadata(arg0, arg1 interface{}) *go
|
||||
}
|
||||
|
||||
// ExportGenesis mocks base method.
|
||||
func (m *MockBankKeeper) ExportGenesis(arg0 types.Context) *types1.GenesisState {
|
||||
func (m *MockBankKeeper) ExportGenesis(arg0 types.Context) *types0.GenesisState {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ExportGenesis", arg0)
|
||||
ret0, _ := ret[0].(*types1.GenesisState)
|
||||
ret0, _ := ret[0].(*types0.GenesisState)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -293,10 +292,10 @@ func (mr *MockBankKeeperMockRecorder) ExportGenesis(arg0 interface{}) *gomock.Ca
|
||||
}
|
||||
|
||||
// GetAccountsBalances mocks base method.
|
||||
func (m *MockBankKeeper) GetAccountsBalances(ctx types.Context) []types1.Balance {
|
||||
func (m *MockBankKeeper) GetAccountsBalances(ctx types.Context) []types0.Balance {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccountsBalances", ctx)
|
||||
ret0, _ := ret[0].([]types1.Balance)
|
||||
ret0, _ := ret[0].([]types0.Balance)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -321,10 +320,10 @@ func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gom
|
||||
}
|
||||
|
||||
// GetAllSendEnabledEntries mocks base method.
|
||||
func (m *MockBankKeeper) GetAllSendEnabledEntries(ctx types.Context) []types1.SendEnabled {
|
||||
func (m *MockBankKeeper) GetAllSendEnabledEntries(ctx types.Context) []types0.SendEnabled {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllSendEnabledEntries", ctx)
|
||||
ret0, _ := ret[0].([]types1.SendEnabled)
|
||||
ret0, _ := ret[0].([]types0.SendEnabled)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -377,10 +376,10 @@ func (mr *MockBankKeeperMockRecorder) GetBlockedAddresses() *gomock.Call {
|
||||
}
|
||||
|
||||
// GetDenomMetaData mocks base method.
|
||||
func (m *MockBankKeeper) GetDenomMetaData(ctx types.Context, denom string) (types1.Metadata, bool) {
|
||||
func (m *MockBankKeeper) GetDenomMetaData(ctx types.Context, denom string) (types0.Metadata, bool) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetDenomMetaData", ctx, denom)
|
||||
ret0, _ := ret[0].(types1.Metadata)
|
||||
ret0, _ := ret[0].(types0.Metadata)
|
||||
ret1, _ := ret[1].(bool)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -408,10 +407,10 @@ func (mr *MockBankKeeperMockRecorder) GetPaginatedTotalSupply(ctx, pagination in
|
||||
}
|
||||
|
||||
// GetParams mocks base method.
|
||||
func (m *MockBankKeeper) GetParams(ctx types.Context) types1.Params {
|
||||
func (m *MockBankKeeper) GetParams(ctx types.Context) types0.Params {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetParams", ctx)
|
||||
ret0, _ := ret[0].(types1.Params)
|
||||
ret0, _ := ret[0].(types0.Params)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -422,10 +421,10 @@ func (mr *MockBankKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call {
|
||||
}
|
||||
|
||||
// GetSendEnabledEntry mocks base method.
|
||||
func (m *MockBankKeeper) GetSendEnabledEntry(ctx types.Context, denom string) (types1.SendEnabled, bool) {
|
||||
func (m *MockBankKeeper) GetSendEnabledEntry(ctx types.Context, denom string) (types0.SendEnabled, bool) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetSendEnabledEntry", ctx, denom)
|
||||
ret0, _ := ret[0].(types1.SendEnabled)
|
||||
ret0, _ := ret[0].(types0.SendEnabled)
|
||||
ret1, _ := ret[1].(bool)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -493,7 +492,7 @@ func (mr *MockBankKeeperMockRecorder) HasSupply(ctx, denom interface{}) *gomock.
|
||||
}
|
||||
|
||||
// InitGenesis mocks base method.
|
||||
func (m *MockBankKeeper) InitGenesis(arg0 types.Context, arg1 *types1.GenesisState) {
|
||||
func (m *MockBankKeeper) InitGenesis(arg0 types.Context, arg1 *types0.GenesisState) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "InitGenesis", arg0, arg1)
|
||||
}
|
||||
@ -505,7 +504,7 @@ func (mr *MockBankKeeperMockRecorder) InitGenesis(arg0, arg1 interface{}) *gomoc
|
||||
}
|
||||
|
||||
// InputOutputCoins mocks base method.
|
||||
func (m *MockBankKeeper) InputOutputCoins(ctx types.Context, inputs []types1.Input, outputs []types1.Output) error {
|
||||
func (m *MockBankKeeper) InputOutputCoins(ctx types.Context, inputs []types0.Input, outputs []types0.Output) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "InputOutputCoins", ctx, inputs, outputs)
|
||||
ret0, _ := ret[0].(error)
|
||||
@ -590,7 +589,7 @@ func (mr *MockBankKeeperMockRecorder) IterateAllBalances(ctx, cb interface{}) *g
|
||||
}
|
||||
|
||||
// IterateAllDenomMetaData mocks base method.
|
||||
func (m *MockBankKeeper) IterateAllDenomMetaData(ctx types.Context, cb func(types1.Metadata) bool) {
|
||||
func (m *MockBankKeeper) IterateAllDenomMetaData(ctx types.Context, cb func(types0.Metadata) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAllDenomMetaData", ctx, cb)
|
||||
}
|
||||
@ -654,10 +653,10 @@ func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}
|
||||
}
|
||||
|
||||
// Params mocks base method.
|
||||
func (m *MockBankKeeper) Params(arg0 context.Context, arg1 *types1.QueryParamsRequest) (*types1.QueryParamsResponse, error) {
|
||||
func (m *MockBankKeeper) Params(arg0 context.Context, arg1 *types0.QueryParamsRequest) (*types0.QueryParamsResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Params", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryParamsResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryParamsResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -725,10 +724,10 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderMod
|
||||
}
|
||||
|
||||
// SendEnabled mocks base method.
|
||||
func (m *MockBankKeeper) SendEnabled(arg0 context.Context, arg1 *types1.QuerySendEnabledRequest) (*types1.QuerySendEnabledResponse, error) {
|
||||
func (m *MockBankKeeper) SendEnabled(arg0 context.Context, arg1 *types0.QuerySendEnabledRequest) (*types0.QuerySendEnabledResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SendEnabled", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QuerySendEnabledResponse)
|
||||
ret0, _ := ret[0].(*types0.QuerySendEnabledResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -740,7 +739,7 @@ func (mr *MockBankKeeperMockRecorder) SendEnabled(arg0, arg1 interface{}) *gomoc
|
||||
}
|
||||
|
||||
// SetAllSendEnabled mocks base method.
|
||||
func (m *MockBankKeeper) SetAllSendEnabled(ctx types.Context, sendEnableds []*types1.SendEnabled) {
|
||||
func (m *MockBankKeeper) SetAllSendEnabled(ctx types.Context, sendEnableds []*types0.SendEnabled) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAllSendEnabled", ctx, sendEnableds)
|
||||
}
|
||||
@ -752,7 +751,7 @@ func (mr *MockBankKeeperMockRecorder) SetAllSendEnabled(ctx, sendEnableds interf
|
||||
}
|
||||
|
||||
// SetDenomMetaData mocks base method.
|
||||
func (m *MockBankKeeper) SetDenomMetaData(ctx types.Context, denomMetaData types1.Metadata) {
|
||||
func (m *MockBankKeeper) SetDenomMetaData(ctx types.Context, denomMetaData types0.Metadata) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetDenomMetaData", ctx, denomMetaData)
|
||||
}
|
||||
@ -764,7 +763,7 @@ func (mr *MockBankKeeperMockRecorder) SetDenomMetaData(ctx, denomMetaData interf
|
||||
}
|
||||
|
||||
// SetParams mocks base method.
|
||||
func (m *MockBankKeeper) SetParams(ctx types.Context, params types1.Params) error {
|
||||
func (m *MockBankKeeper) SetParams(ctx types.Context, params types0.Params) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SetParams", ctx, params)
|
||||
ret0, _ := ret[0].(error)
|
||||
@ -790,10 +789,10 @@ func (mr *MockBankKeeperMockRecorder) SetSendEnabled(ctx, denom, value interface
|
||||
}
|
||||
|
||||
// SpendableBalances mocks base method.
|
||||
func (m *MockBankKeeper) SpendableBalances(arg0 context.Context, arg1 *types1.QuerySpendableBalancesRequest) (*types1.QuerySpendableBalancesResponse, error) {
|
||||
func (m *MockBankKeeper) SpendableBalances(arg0 context.Context, arg1 *types0.QuerySpendableBalancesRequest) (*types0.QuerySpendableBalancesResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SpendableBalances", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QuerySpendableBalancesResponse)
|
||||
ret0, _ := ret[0].(*types0.QuerySpendableBalancesResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -833,10 +832,10 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom
|
||||
}
|
||||
|
||||
// SupplyOf mocks base method.
|
||||
func (m *MockBankKeeper) SupplyOf(arg0 context.Context, arg1 *types1.QuerySupplyOfRequest) (*types1.QuerySupplyOfResponse, error) {
|
||||
func (m *MockBankKeeper) SupplyOf(arg0 context.Context, arg1 *types0.QuerySupplyOfRequest) (*types0.QuerySupplyOfResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SupplyOf", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QuerySupplyOfResponse)
|
||||
ret0, _ := ret[0].(*types0.QuerySupplyOfResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -848,10 +847,10 @@ func (mr *MockBankKeeperMockRecorder) SupplyOf(arg0, arg1 interface{}) *gomock.C
|
||||
}
|
||||
|
||||
// TotalSupply mocks base method.
|
||||
func (m *MockBankKeeper) TotalSupply(arg0 context.Context, arg1 *types1.QueryTotalSupplyRequest) (*types1.QueryTotalSupplyResponse, error) {
|
||||
func (m *MockBankKeeper) TotalSupply(arg0 context.Context, arg1 *types0.QueryTotalSupplyRequest) (*types0.QueryTotalSupplyResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "TotalSupply", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.QueryTotalSupplyResponse)
|
||||
ret0, _ := ret[0].(*types0.QueryTotalSupplyResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -956,7 +955,7 @@ func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call
|
||||
}
|
||||
|
||||
// IterateBondedValidatorsByPower mocks base method.
|
||||
func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types2.ValidatorI) bool) {
|
||||
func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1)
|
||||
}
|
||||
@ -968,7 +967,7 @@ func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, ar
|
||||
}
|
||||
|
||||
// IterateDelegations mocks base method.
|
||||
func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types2.DelegationI) bool) {
|
||||
func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn)
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@ package types
|
||||
|
||||
import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
@ -29,13 +29,13 @@ type StakingKeeper interface {
|
||||
|
||||
// AccountKeeper defines the expected account keeper (noalias)
|
||||
type AccountKeeper interface {
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
|
||||
GetModuleAddress(name string) sdk.AccAddress
|
||||
GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI
|
||||
GetModuleAccount(ctx sdk.Context, name string) sdk.ModuleAccountI
|
||||
|
||||
// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
|
||||
SetModuleAccount(sdk.Context, types.ModuleAccountI)
|
||||
SetModuleAccount(sdk.Context, sdk.ModuleAccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -2,21 +2,20 @@ package group
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
type AccountKeeper interface {
|
||||
// NewAccount returns a new account with the next account number. Does not save the new account to the store.
|
||||
NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI
|
||||
NewAccount(sdk.Context, sdk.AccountI) sdk.AccountI
|
||||
|
||||
// GetAccount retrieves an account from the store.
|
||||
GetAccount(sdk.Context, sdk.AccAddress) authtypes.AccountI
|
||||
GetAccount(sdk.Context, sdk.AccAddress) sdk.AccountI
|
||||
|
||||
// SetAccount sets an account in the store.
|
||||
SetAccount(sdk.Context, authtypes.AccountI)
|
||||
SetAccount(sdk.Context, sdk.AccountI)
|
||||
|
||||
// RemoveAccount Remove an account in the store.
|
||||
RemoveAccount(ctx sdk.Context, acc authtypes.AccountI)
|
||||
RemoveAccount(ctx sdk.Context, acc sdk.AccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -138,7 +138,7 @@ func (s TestSuite) setNextAccount() { //nolint:govet // this is a test and we're
|
||||
|
||||
s.accountKeeper.EXPECT().GetAccount(gomock.Any(), sdk.AccAddress(accountCredentials.Address())).Return(nil).AnyTimes()
|
||||
s.accountKeeper.EXPECT().NewAccount(gomock.Any(), groupPolicyAcc).Return(groupPolicyAccBumpAccountNumber).AnyTimes()
|
||||
s.accountKeeper.EXPECT().SetAccount(gomock.Any(), authtypes.AccountI(groupPolicyAccBumpAccountNumber)).Return().AnyTimes()
|
||||
s.accountKeeper.EXPECT().SetAccount(gomock.Any(), sdk.AccountI(groupPolicyAccBumpAccountNumber)).Return().AnyTimes()
|
||||
}
|
||||
|
||||
func TestKeeperTestSuite(t *testing.T) {
|
||||
|
||||
@ -3,6 +3,7 @@ package v2
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
@ -19,7 +20,7 @@ func MigrateGenState(oldState *authtypes.GenesisState) *authtypes.GenesisState {
|
||||
|
||||
groupPolicyAccountCounter := uint64(0)
|
||||
for i, acc := range accounts {
|
||||
modAcc, ok := acc.(authtypes.ModuleAccountI)
|
||||
modAcc, ok := acc.(sdk.ModuleAccountI)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/group/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/simulation"
|
||||
|
||||
@ -1195,7 +1194,7 @@ func SimulateMsgLeaveGroup(cdc *codec.ProtoCodec, k keeper.Keeper, ak group.Acco
|
||||
|
||||
func randomGroup(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
ctx sdk.Context, accounts []simtypes.Account,
|
||||
) (groupInfo *group.GroupInfo, acc simtypes.Account, account authtypes.AccountI, err error) {
|
||||
) (groupInfo *group.GroupInfo, acc simtypes.Account, account sdk.AccountI, err error) {
|
||||
groupID := k.GetGroupSequence(ctx)
|
||||
|
||||
switch {
|
||||
@ -1233,7 +1232,7 @@ func randomGroup(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
|
||||
func randomGroupPolicy(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
ctx sdk.Context, accounts []simtypes.Account,
|
||||
) (groupInfo *group.GroupInfo, groupPolicyInfo *group.GroupPolicyInfo, acc simtypes.Account, account authtypes.AccountI, err error) {
|
||||
) (groupInfo *group.GroupInfo, groupPolicyInfo *group.GroupPolicyInfo, acc simtypes.Account, account sdk.AccountI, err error) {
|
||||
groupInfo, _, _, err = randomGroup(r, k, ak, ctx, accounts)
|
||||
if err != nil {
|
||||
return nil, nil, simtypes.Account{}, nil, err
|
||||
@ -1265,7 +1264,7 @@ func randomGroupPolicy(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
|
||||
func randomMember(ctx context.Context, r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper,
|
||||
accounts []simtypes.Account, groupID uint64,
|
||||
) (acc simtypes.Account, account authtypes.AccountI, err error) {
|
||||
) (acc simtypes.Account, account sdk.AccountI, err error) {
|
||||
res, err := k.GroupMembers(ctx, &group.QueryGroupMembersRequest{
|
||||
GroupId: groupID,
|
||||
})
|
||||
|
||||
@ -9,8 +9,7 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -38,10 +37,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(arg0 types.Context, arg1 types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(arg0 types.Context, arg1 types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", arg0, arg1)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -52,10 +51,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// NewAccount mocks base method.
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types0.AccountI) types0.AccountI {
|
||||
func (m *MockAccountKeeper) NewAccount(arg0 types.Context, arg1 types.AccountI) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewAccount", arg0, arg1)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -66,7 +65,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccount(arg0, arg1 interface{}) *gom
|
||||
}
|
||||
|
||||
// RemoveAccount mocks base method.
|
||||
func (m *MockAccountKeeper) RemoveAccount(ctx types.Context, acc types0.AccountI) {
|
||||
func (m *MockAccountKeeper) RemoveAccount(ctx types.Context, acc types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "RemoveAccount", ctx, acc)
|
||||
}
|
||||
@ -78,7 +77,7 @@ func (mr *MockAccountKeeperMockRecorder) RemoveAccount(ctx, acc interface{}) *go
|
||||
}
|
||||
|
||||
// SetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetAccount(arg0 types.Context, arg1 types0.AccountI) {
|
||||
func (m *MockAccountKeeper) SetAccount(arg0 types.Context, arg1 types.AccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetAccount", arg0, arg1)
|
||||
}
|
||||
@ -141,10 +140,10 @@ func (mr *MockBankKeeperMockRecorder) MintCoins(ctx, moduleName, amt interface{}
|
||||
}
|
||||
|
||||
// MultiSend mocks base method.
|
||||
func (m *MockBankKeeper) MultiSend(arg0 context.Context, arg1 *types1.MsgMultiSend) (*types1.MsgMultiSendResponse, error) {
|
||||
func (m *MockBankKeeper) MultiSend(arg0 context.Context, arg1 *types0.MsgMultiSend) (*types0.MsgMultiSendResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MultiSend", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.MsgMultiSendResponse)
|
||||
ret0, _ := ret[0].(*types0.MsgMultiSendResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -156,10 +155,10 @@ func (mr *MockBankKeeperMockRecorder) MultiSend(arg0, arg1 interface{}) *gomock.
|
||||
}
|
||||
|
||||
// Send mocks base method.
|
||||
func (m *MockBankKeeper) Send(arg0 context.Context, arg1 *types1.MsgSend) (*types1.MsgSendResponse, error) {
|
||||
func (m *MockBankKeeper) Send(arg0 context.Context, arg1 *types0.MsgSend) (*types0.MsgSendResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Send", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.MsgSendResponse)
|
||||
ret0, _ := ret[0].(*types0.MsgSendResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -185,10 +184,10 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo
|
||||
}
|
||||
|
||||
// SetSendEnabled mocks base method.
|
||||
func (m *MockBankKeeper) SetSendEnabled(arg0 context.Context, arg1 *types1.MsgSetSendEnabled) (*types1.MsgSetSendEnabledResponse, error) {
|
||||
func (m *MockBankKeeper) SetSendEnabled(arg0 context.Context, arg1 *types0.MsgSetSendEnabled) (*types0.MsgSetSendEnabledResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SetSendEnabled", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.MsgSetSendEnabledResponse)
|
||||
ret0, _ := ret[0].(*types0.MsgSetSendEnabledResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@ -214,10 +213,10 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom
|
||||
}
|
||||
|
||||
// UpdateParams mocks base method.
|
||||
func (m *MockBankKeeper) UpdateParams(arg0 context.Context, arg1 *types1.MsgUpdateParams) (*types1.MsgUpdateParamsResponse, error) {
|
||||
func (m *MockBankKeeper) UpdateParams(arg0 context.Context, arg1 *types0.MsgUpdateParams) (*types0.MsgUpdateParamsResponse, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UpdateParams", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types1.MsgUpdateParamsResponse)
|
||||
ret0, _ := ret[0].(*types0.MsgUpdateParamsResponse)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import (
|
||||
|
||||
math "cosmossdk.io/math"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -88,10 +87,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -116,7 +115,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom
|
||||
}
|
||||
|
||||
// SetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) {
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types.ModuleAccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetModuleAccount", arg0, arg1)
|
||||
}
|
||||
|
||||
@ -2,8 +2,8 @@ package types // noalias
|
||||
|
||||
import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// StakingKeeper defines the expected staking keeper
|
||||
@ -17,8 +17,8 @@ type AccountKeeper interface {
|
||||
GetModuleAddress(name string) sdk.AccAddress
|
||||
|
||||
// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
|
||||
SetModuleAccount(sdk.Context, types.ModuleAccountI)
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
|
||||
SetModuleAccount(sdk.Context, sdk.ModuleAccountI)
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) sdk.ModuleAccountI
|
||||
}
|
||||
|
||||
// BankKeeper defines the contract needed to be fulfilled for banking and supply
|
||||
|
||||
@ -2,7 +2,6 @@ package nft
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// BankKeeper defines the contract needed to be fulfilled for banking and supply
|
||||
@ -14,5 +13,5 @@ type BankKeeper interface {
|
||||
// AccountKeeper defines the contract required for account APIs.
|
||||
type AccountKeeper interface {
|
||||
GetModuleAddress(name string) sdk.AccAddress
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -73,10 +72,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
|
||||
@ -2,12 +2,11 @@ package simulation
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// AccountKeeper defines the expected account keeper used for simulations (noalias)
|
||||
type AccountKeeper interface {
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -9,9 +9,8 @@ import (
|
||||
|
||||
math "cosmossdk.io/math"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
types2 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -39,10 +38,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -53,7 +52,7 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, process)
|
||||
}
|
||||
@ -179,7 +178,7 @@ func (mr *MockParamSubspaceMockRecorder) Get(ctx, key, ptr interface{}) *gomock.
|
||||
}
|
||||
|
||||
// GetParamSet mocks base method.
|
||||
func (m *MockParamSubspace) GetParamSet(ctx types.Context, ps types1.ParamSet) {
|
||||
func (m *MockParamSubspace) GetParamSet(ctx types.Context, ps types0.ParamSet) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "GetParamSet", ctx, ps)
|
||||
}
|
||||
@ -205,7 +204,7 @@ func (mr *MockParamSubspaceMockRecorder) HasKeyTable() *gomock.Call {
|
||||
}
|
||||
|
||||
// SetParamSet mocks base method.
|
||||
func (m *MockParamSubspace) SetParamSet(ctx types.Context, ps types1.ParamSet) {
|
||||
func (m *MockParamSubspace) SetParamSet(ctx types.Context, ps types0.ParamSet) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetParamSet", ctx, ps)
|
||||
}
|
||||
@ -217,10 +216,10 @@ func (mr *MockParamSubspaceMockRecorder) SetParamSet(ctx, ps interface{}) *gomoc
|
||||
}
|
||||
|
||||
// WithKeyTable mocks base method.
|
||||
func (m *MockParamSubspace) WithKeyTable(table types1.KeyTable) types1.Subspace {
|
||||
func (m *MockParamSubspace) WithKeyTable(table types0.KeyTable) types0.Subspace {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "WithKeyTable", table)
|
||||
ret0, _ := ret[0].(types1.Subspace)
|
||||
ret0, _ := ret[0].(types0.Subspace)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -254,10 +253,10 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// Delegation mocks base method.
|
||||
func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types2.DelegationI {
|
||||
func (m *MockStakingKeeper) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types1.DelegationI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(types2.DelegationI)
|
||||
ret0, _ := ret[0].(types1.DelegationI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -268,10 +267,10 @@ func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 interface{}
|
||||
}
|
||||
|
||||
// GetAllValidators mocks base method.
|
||||
func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types2.Validator {
|
||||
func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types1.Validator {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAllValidators", ctx)
|
||||
ret0, _ := ret[0].([]types2.Validator)
|
||||
ret0, _ := ret[0].([]types1.Validator)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -296,7 +295,7 @@ func (mr *MockStakingKeeperMockRecorder) IsValidatorJailed(ctx, addr interface{}
|
||||
}
|
||||
|
||||
// IterateValidators mocks base method.
|
||||
func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types2.ValidatorI) bool) {
|
||||
func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateValidators", arg0, arg1)
|
||||
}
|
||||
@ -348,7 +347,7 @@ func (mr *MockStakingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 inte
|
||||
}
|
||||
|
||||
// SlashWithInfractionReason mocks base method.
|
||||
func (m *MockStakingKeeper) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types2.Infraction) math.Int {
|
||||
func (m *MockStakingKeeper) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types1.Infraction) math.Int {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5)
|
||||
ret0, _ := ret[0].(math.Int)
|
||||
@ -374,10 +373,10 @@ func (mr *MockStakingKeeperMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.
|
||||
}
|
||||
|
||||
// Validator mocks base method.
|
||||
func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types2.ValidatorI {
|
||||
func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types1.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Validator", arg0, arg1)
|
||||
ret0, _ := ret[0].(types2.ValidatorI)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -388,10 +387,10 @@ func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 interface{}) *gomo
|
||||
}
|
||||
|
||||
// ValidatorByConsAddr mocks base method.
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types2.ValidatorI {
|
||||
func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types1.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1)
|
||||
ret0, _ := ret[0].(types2.ValidatorI)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
|
||||
@ -2,16 +2,16 @@ package types
|
||||
|
||||
import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
auth "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
// AccountKeeper expected account keeper
|
||||
type AccountKeeper interface {
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
|
||||
IterateAccounts(ctx sdk.Context, process func(auth.AccountI) (stop bool))
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI
|
||||
IterateAccounts(ctx sdk.Context, process func(sdk.AccountI) (stop bool))
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
@ -2,18 +2,18 @@ package keeper
|
||||
|
||||
import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
// GetBondedPool returns the bonded tokens pool's module account
|
||||
func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool authtypes.ModuleAccountI) {
|
||||
func (k Keeper) GetBondedPool(ctx sdk.Context) (bondedPool sdk.ModuleAccountI) {
|
||||
return k.authKeeper.GetModuleAccount(ctx, types.BondedPoolName)
|
||||
}
|
||||
|
||||
// GetNotBondedPool returns the not bonded tokens pool's module account
|
||||
func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool authtypes.ModuleAccountI) {
|
||||
func (k Keeper) GetNotBondedPool(ctx sdk.Context) (notBondedPool sdk.ModuleAccountI) {
|
||||
return k.authKeeper.GetModuleAccount(ctx, types.NotBondedPoolName)
|
||||
}
|
||||
|
||||
|
||||
@ -9,8 +9,7 @@ import (
|
||||
|
||||
math "cosmossdk.io/math"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
types1 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@ -89,10 +88,10 @@ func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder {
|
||||
}
|
||||
|
||||
// GetAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI {
|
||||
func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types.AccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccount", ctx, addr)
|
||||
ret0, _ := ret[0].(types0.AccountI)
|
||||
ret0, _ := ret[0].(types.AccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -103,10 +102,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo
|
||||
}
|
||||
|
||||
// GetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types0.ModuleAccountI {
|
||||
func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, moduleName string) types.ModuleAccountI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName)
|
||||
ret0, _ := ret[0].(types0.ModuleAccountI)
|
||||
ret0, _ := ret[0].(types.ModuleAccountI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -131,7 +130,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom
|
||||
}
|
||||
|
||||
// IterateAccounts mocks base method.
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types0.AccountI) bool) {
|
||||
func (m *MockAccountKeeper) IterateAccounts(ctx types.Context, process func(types.AccountI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateAccounts", ctx, process)
|
||||
}
|
||||
@ -143,7 +142,7 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{
|
||||
}
|
||||
|
||||
// SetModuleAccount mocks base method.
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) {
|
||||
func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types.ModuleAccountI) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "SetModuleAccount", arg0, arg1)
|
||||
}
|
||||
@ -327,10 +326,10 @@ func (m *MockValidatorSet) EXPECT() *MockValidatorSetMockRecorder {
|
||||
}
|
||||
|
||||
// Delegation mocks base method.
|
||||
func (m *MockValidatorSet) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types1.DelegationI {
|
||||
func (m *MockValidatorSet) Delegation(arg0 types.Context, arg1 types.AccAddress, arg2 types.ValAddress) types0.DelegationI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(types1.DelegationI)
|
||||
ret0, _ := ret[0].(types0.DelegationI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -341,7 +340,7 @@ func (mr *MockValidatorSetMockRecorder) Delegation(arg0, arg1, arg2 interface{})
|
||||
}
|
||||
|
||||
// IterateBondedValidatorsByPower mocks base method.
|
||||
func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1)
|
||||
}
|
||||
@ -353,7 +352,7 @@ func (mr *MockValidatorSetMockRecorder) IterateBondedValidatorsByPower(arg0, arg
|
||||
}
|
||||
|
||||
// IterateLastValidators mocks base method.
|
||||
func (m *MockValidatorSet) IterateLastValidators(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
func (m *MockValidatorSet) IterateLastValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateLastValidators", arg0, arg1)
|
||||
}
|
||||
@ -365,7 +364,7 @@ func (mr *MockValidatorSetMockRecorder) IterateLastValidators(arg0, arg1 interfa
|
||||
}
|
||||
|
||||
// IterateValidators mocks base method.
|
||||
func (m *MockValidatorSet) IterateValidators(arg0 types.Context, arg1 func(int64, types1.ValidatorI) bool) {
|
||||
func (m *MockValidatorSet) IterateValidators(arg0 types.Context, arg1 func(int64, types0.ValidatorI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateValidators", arg0, arg1)
|
||||
}
|
||||
@ -417,7 +416,7 @@ func (mr *MockValidatorSetMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 inter
|
||||
}
|
||||
|
||||
// SlashWithInfractionReason mocks base method.
|
||||
func (m *MockValidatorSet) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types1.Infraction) math.Int {
|
||||
func (m *MockValidatorSet) SlashWithInfractionReason(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types0.Infraction) math.Int {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5)
|
||||
ret0, _ := ret[0].(math.Int)
|
||||
@ -471,10 +470,10 @@ func (mr *MockValidatorSetMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.C
|
||||
}
|
||||
|
||||
// Validator mocks base method.
|
||||
func (m *MockValidatorSet) Validator(arg0 types.Context, arg1 types.ValAddress) types1.ValidatorI {
|
||||
func (m *MockValidatorSet) Validator(arg0 types.Context, arg1 types.ValAddress) types0.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Validator", arg0, arg1)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
ret0, _ := ret[0].(types0.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -485,10 +484,10 @@ func (mr *MockValidatorSetMockRecorder) Validator(arg0, arg1 interface{}) *gomoc
|
||||
}
|
||||
|
||||
// ValidatorByConsAddr mocks base method.
|
||||
func (m *MockValidatorSet) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types1.ValidatorI {
|
||||
func (m *MockValidatorSet) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types0.ValidatorI {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1)
|
||||
ret0, _ := ret[0].(types1.ValidatorI)
|
||||
ret0, _ := ret[0].(types0.ValidatorI)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -522,10 +521,10 @@ func (m *MockDelegationSet) EXPECT() *MockDelegationSetMockRecorder {
|
||||
}
|
||||
|
||||
// GetValidatorSet mocks base method.
|
||||
func (m *MockDelegationSet) GetValidatorSet() types1.ValidatorSet {
|
||||
func (m *MockDelegationSet) GetValidatorSet() types0.ValidatorSet {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetValidatorSet")
|
||||
ret0, _ := ret[0].(types1.ValidatorSet)
|
||||
ret0, _ := ret[0].(types0.ValidatorSet)
|
||||
return ret0
|
||||
}
|
||||
|
||||
@ -536,7 +535,7 @@ func (mr *MockDelegationSetMockRecorder) GetValidatorSet() *gomock.Call {
|
||||
}
|
||||
|
||||
// IterateDelegations mocks base method.
|
||||
func (m *MockDelegationSet) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) {
|
||||
func (m *MockDelegationSet) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types0.DelegationI) bool) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn)
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
)
|
||||
|
||||
// DistributionKeeper expected distribution keeper (noalias)
|
||||
@ -15,14 +14,14 @@ type DistributionKeeper interface {
|
||||
|
||||
// AccountKeeper defines the expected account keeper (noalias)
|
||||
type AccountKeeper interface {
|
||||
IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool))
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI // only used for simulation
|
||||
IterateAccounts(ctx sdk.Context, process func(sdk.AccountI) (stop bool))
|
||||
GetAccount(ctx sdk.Context, addr sdk.AccAddress) sdk.AccountI // only used for simulation
|
||||
|
||||
GetModuleAddress(name string) sdk.AccAddress
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
|
||||
GetModuleAccount(ctx sdk.Context, moduleName string) sdk.ModuleAccountI
|
||||
|
||||
// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
|
||||
SetModuleAccount(sdk.Context, authtypes.ModuleAccountI)
|
||||
SetModuleAccount(sdk.Context, sdk.ModuleAccountI)
|
||||
}
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user