Documentation ¶
Index ¶
- Constants
- Variables
- func AddAllowedCosmosDenomsParamChangeToStabilityCommittee(ctx sdk.Context, cdc codectypes.InterfaceRegistry, ...)
- func AllowEip712SigningForConvertMessages(ctx sdk.Context, evmKeeper *evmkeeper.Keeper)
- func GeneratePrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddress)
- func GetMaccPerms() map[string][]string
- func InitializeEvmutilAllowedCosmosDenoms(ctx sdk.Context, evmutilKeeper *evmutilkeeper.Keeper, ...)
- func MainnetUpgradeHandler(app App) upgradetypes.UpgradeHandler
- func MakeEncodingConfig() params.EncodingConfig
- func RandomAddress() sdk.AccAddress
- func RegisterAPIRouteRewrites(router *mux.Router)
- func SetBech32AddressPrefixes(config *sdk.Config)
- func SetBip44CoinType(config *sdk.Config)
- func SetSDKConfig() *sdk.Config
- func TestnetUpgradeHandler(app App) upgradetypes.UpgradeHandler
- type App
- func (app *App) AppCodec() codec.Codec
- func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (servertypes.ExportedApp, error)
- func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *App) InterfaceRegistry() types.InterfaceRegistry
- func (app *App) LegacyAmino() *codec.LegacyAmino
- func (app *App) LoadHeight(height int64) error
- func (app *App) ModuleAccountAddrs() map[string]bool
- func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *App) RegisterNodeService(clientCtx client.Context)
- func (app *App) RegisterServices(cfg module.Configurator)
- func (app *App) RegisterTendermintService(clientCtx client.Context)
- func (app *App) RegisterTxService(clientCtx client.Context)
- func (app App) RegisterUpgradeHandlers()
- func (app *App) SimulationManager() *module.SimulationManager
- type AuthBankGenesisBuilder
- func (builder *AuthBankGenesisBuilder) BuildMarshalled(cdc codec.JSONCodec) GenesisState
- func (builder *AuthBankGenesisBuilder) WithAccounts(account ...authtypes.GenesisAccount) *AuthBankGenesisBuilder
- func (builder *AuthBankGenesisBuilder) WithBalances(balance ...banktypes.Balance) *AuthBankGenesisBuilder
- func (builder *AuthBankGenesisBuilder) WithSimpleAccount(address sdk.AccAddress, balance sdk.Coins) *AuthBankGenesisBuilder
- func (builder *AuthBankGenesisBuilder) WithSimpleModuleAccount(moduleName string, balance sdk.Coins, permissions ...string) *AuthBankGenesisBuilder
- func (builder *AuthBankGenesisBuilder) WithSimplePeriodicVestingAccount(address sdk.AccAddress, balance sdk.Coins, periods vestingtypes.Periods, ...) *AuthBankGenesisBuilder
- type GenesisState
- func GenesisStateWithSingleValidator(app *TestApp, genesisState GenesisState) GenesisState
- func NewDefaultGenesisState() GenesisState
- func NewFundedGenStateWithCoins(cdc codec.JSONCodec, coins []sdk.Coins, addresses []sdk.AccAddress) GenesisState
- func NewFundedGenStateWithSameCoins(cdc codec.JSONCodec, balance sdk.Coins, addresses []sdk.AccAddress) GenesisState
- func NewFundedGenStateWithSameCoinsWithModuleAccount(cdc codec.JSONCodec, coins sdk.Coins, addresses []sdk.AccAddress, ...) GenesisState
- type Options
- type TallyHandler
- type TestApp
- func (tApp TestApp) CheckBalance(t *testing.T, ctx sdk.Context, owner sdk.AccAddress, expectedCoins sdk.Coins)
- func (tApp TestApp) CreateNewUnbondedValidator(ctx sdk.Context, valAddress sdk.ValAddress, selfDelegation sdkmath.Int) error
- func (tApp TestApp) DeleteGenesisValidator(t *testing.T, ctx sdk.Context)
- func (tApp TestApp) DeleteGenesisValidatorCoins(t *testing.T, ctx sdk.Context)
- func (tApp TestApp) FundAccount(ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error
- func (tApp TestApp) FundModuleAccount(ctx sdk.Context, recipientMod string, amounts sdk.Coins) error
- func (tApp TestApp) GetAccountKeeper() authkeeper.AccountKeeper
- func (tApp TestApp) GetAuctionKeeper() auctionkeeper.Keeper
- func (tApp TestApp) GetBankKeeper() bankkeeper.Keeper
- func (tApp TestApp) GetBep3Keeper() bep3keeper.Keeper
- func (tApp TestApp) GetCDPKeeper() cdpkeeper.Keeper
- func (tApp TestApp) GetCommitteeKeeper() committeekeeper.Keeper
- func (tApp TestApp) GetCommunityKeeper() communitykeeper.Keeper
- func (tApp TestApp) GetCrisisKeeper() crisiskeeper.Keeper
- func (tApp TestApp) GetDistrKeeper() distkeeper.Keeper
- func (tApp TestApp) GetEarnKeeper() earnkeeper.Keeper
- func (tApp TestApp) GetEvmKeeper() *evmkeeper.Keeper
- func (tApp TestApp) GetEvmutilKeeper() evmutilkeeper.Keeper
- func (tApp TestApp) GetFeeMarketKeeper() feemarketkeeper.Keeper
- func (tApp TestApp) GetGovKeeper() govkeeper.Keeper
- func (tApp TestApp) GetHardKeeper() hardkeeper.Keeper
- func (tApp TestApp) GetIncentiveKeeper() incentivekeeper.Keeper
- func (tApp TestApp) GetIssuanceKeeper() issuancekeeper.Keeper
- func (tApp TestApp) GetKavadistKeeper() kavadistkeeper.Keeper
- func (tApp TestApp) GetLiquidKeeper() liquidkeeper.Keeper
- func (tApp TestApp) GetMintKeeper() mintkeeper.Keeper
- func (tApp TestApp) GetModuleAccountBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int
- func (tApp TestApp) GetParamsKeeper() paramskeeper.Keeper
- func (tApp TestApp) GetPriceFeedKeeper() pricefeedkeeper.Keeper
- func (tApp TestApp) GetRouterKeeper() routerkeeper.Keeper
- func (tApp TestApp) GetSavingsKeeper() savingskeeper.Keeper
- func (tApp TestApp) GetSlashingKeeper() slashingkeeper.Keeper
- func (tApp TestApp) GetStakingKeeper() stakingkeeper.Keeper
- func (tApp TestApp) GetSwapKeeper() swapkeeper.Keeper
- func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp
- func (tApp TestApp) InitializeFromGenesisStatesWithTime(genTime time.Time, genesisStates ...GenesisState) TestApp
- func (tApp TestApp) InitializeFromGenesisStatesWithTimeAndChainID(genTime time.Time, chainID string, genesisStates ...GenesisState) TestApp
- func (tApp TestApp) InitializeFromGenesisStatesWithTimeAndChainIDAndHeight(genTime time.Time, chainID string, initialHeight int64, addValidator bool, ...) TestApp
- func (tApp TestApp) NewQueryServerTestHelper(ctx sdk.Context) *baseapp.QueryServiceTestHelper
- func (tApp TestApp) SetInflation(ctx sdk.Context, value sdk.Dec)
Constants ¶
const ( // Bech32MainPrefix defines the Bech32 prefix for account addresses Bech32MainPrefix = "kava" // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = Bech32MainPrefix + "pub" // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = Bech32MainPrefix + "val" + "oper" // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = Bech32MainPrefix + "val" + "oper" + "pub" // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = Bech32MainPrefix + "val" + "cons" // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = Bech32MainPrefix + "val" + "cons" + "pub" Bip44CoinType = 459 // see https://github.com/satoshilabs/slips/blob/master/slip-0044.md )
const ( MainnetUpgradeName = "v0.24.0" TestnetUpgradeName = "v0.24.0-alpha.0" MainnetAtomDenom = "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2" TestnetHardDenom = "hard" MainnetStabilityCommitteeId = uint64(1) TestnetStabilityCommitteeId = uint64(1) )
Variables ¶
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string // ModuleBasics manages simple versions of full app modules. // It's used for things such as codec registration and genesis file verification. ModuleBasics = module.NewBasicManager( genutil.AppModuleBasic{}, auth.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic([]govclient.ProposalHandler{ paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, kavadistclient.ProposalHandler, committeeclient.ProposalHandler, earnclient.DepositProposalHandler, earnclient.WithdrawProposalHandler, communityclient.LendDepositProposalHandler, communityclient.LendWithdrawProposalHandler, }), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, evm.AppModuleBasic{}, feemarket.AppModuleBasic{}, kavadist.AppModuleBasic{}, auction.AppModuleBasic{}, issuance.AppModuleBasic{}, bep3.AppModuleBasic{}, pricefeed.AppModuleBasic{}, swap.AppModuleBasic{}, cdp.AppModuleBasic{}, hard.AppModuleBasic{}, committee.AppModuleBasic{}, incentive.AppModuleBasic{}, savings.AppModuleBasic{}, validatorvesting.AppModuleBasic{}, evmutil.AppModuleBasic{}, liquid.AppModuleBasic{}, earn.AppModuleBasic{}, router.AppModuleBasic{}, mint.AppModuleBasic{}, community.AppModuleBasic{}, ) )
var ( // Committee permission for changing AllowedCosmosDenoms param AllowedParamsChangeAllowedCosmosDenoms = committeetypes.AllowedParamsChange{ Subspace: evmutiltypes.ModuleName, Key: "AllowedCosmosDenoms", } // EIP712 allowed message for MsgConvertCosmosCoinToERC20 EIP712AllowedMsgConvertCosmosCoinToERC20 = evmtypes.EIP712AllowedMsg{ MsgTypeUrl: "/kava.evmutil.v1beta1.MsgConvertCosmosCoinToERC20", MsgValueTypeName: "MsgConvertCosmosCoinToERC20", ValueTypes: []evmtypes.EIP712MsgAttrType{ { Name: "initiator", Type: "string", }, { Name: "receiver", Type: "string", }, { Name: "amount", Type: "Coin", }, }, NestedTypes: nil, } // EIP712 allowed message for MsgConvertCosmosCoinFromERC20 EIP712AllowedMsgConvertCosmosCoinFromERC20 = evmtypes.EIP712AllowedMsg{ MsgTypeUrl: "/kava.evmutil.v1beta1.MsgConvertCosmosCoinFromERC20", MsgValueTypeName: "MsgConvertCosmosCoinFromERC20", ValueTypes: []evmtypes.EIP712MsgAttrType{ { Name: "initiator", Type: "string", }, { Name: "receiver", Type: "string", }, { Name: "amount", Type: "Coin", }, }, NestedTypes: nil, } )
var DefaultOptions = Options{ EVMTrace: ethermintconfig.DefaultEVMTracer, EVMMaxGasWanted: ethermintconfig.DefaultMaxTxGasWanted, }
DefaultOptions is a sensible default Options value.
Functions ¶
func AddAllowedCosmosDenomsParamChangeToStabilityCommittee ¶ added in v0.24.0
func AddAllowedCosmosDenomsParamChangeToStabilityCommittee( ctx sdk.Context, cdc codectypes.InterfaceRegistry, committeeKeeper *committeekeeper.Keeper, committeeId uint64, )
AddAllowedCosmosDenomsParamChangeToStabilityCommittee enables the stability committee to update the AllowedCosmosDenoms parameter of x/evmutil.
func AllowEip712SigningForConvertMessages ¶ added in v0.24.0
AllowEip712SigningForConvertMessages adds the cosmos coin conversion messages to the allowed message types for EIP712 signing. The newly allowed messages are: - MsgConvertCosmosCoinToERC20 - MsgConvertCosmosCoinFromERC20
func GeneratePrivKeyAddressPairs ¶ added in v0.4.1
func GeneratePrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddress)
GeneratePrivKeyAddressPairsFromRand generates (deterministically) a total of n private keys and addresses.
func GetMaccPerms ¶ added in v0.3.0
GetMaccPerms returns a mapping of the application's module account permissions.
func InitializeEvmutilAllowedCosmosDenoms ¶ added in v0.24.0
func InitializeEvmutilAllowedCosmosDenoms( ctx sdk.Context, evmutilKeeper *evmutilkeeper.Keeper, allowedCoins []evmutiltypes.AllowedCosmosCoinERC20Token, )
InitializeEvmutilAllowedCosmosDenoms sets the AllowedCosmosDenoms parameter of the x/evmutil module. This new parameter controls what cosmos denoms are allowed to be converted to ERC20 tokens.
func MainnetUpgradeHandler ¶ added in v0.21.0
func MainnetUpgradeHandler(app App) upgradetypes.UpgradeHandler
func MakeEncodingConfig ¶ added in v0.16.0
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig and registers the app's types on it.
func RandomAddress ¶ added in v0.19.0
func RandomAddress() sdk.AccAddress
RandomAddress non-deterministically generates a new address, discarding the private key.
func RegisterAPIRouteRewrites ¶ added in v0.23.0
RegisterAPIRouteRewrites registers overwritten API routes that are registered after this function is called. This must be called before any other route registrations on the router in order for rewrites to take effect. The first route that matches in the mux router wins, so any registrations here will be prioritized over the later registrations in modules.
func SetBech32AddressPrefixes ¶
SetBech32AddressPrefixes sets the global prefix to be used when serializing addresses to bech32 strings.
func SetBip44CoinType ¶ added in v0.3.2
SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.
func SetSDKConfig ¶ added in v0.16.0
SetSDKConfig configures the global config with kava app specific parameters. It does not seal the config to allow modification in tests.
func TestnetUpgradeHandler ¶ added in v0.21.0
func TestnetUpgradeHandler(app App) upgradetypes.UpgradeHandler
Types ¶
type App ¶
type App struct { *baseapp.BaseApp // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper // contains filtered or unexported fields }
App is the Kava ABCI application.
func NewApp ¶
func NewApp( logger tmlog.Logger, db dbm.DB, homePath string, traceStore io.Writer, encodingConfig kavaparams.EncodingConfig, options Options, baseAppOptions ...func(*baseapp.BaseApp), ) *App
NewApp returns a reference to an initialized App.
func (*App) BeginBlocker ¶
func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker contains app specific logic for the BeginBlock abci call.
func (*App) EndBlocker ¶
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker contains app specific logic for the EndBlock abci call.
func (*App) ExportAppStateAndValidators ¶
func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators export the state of the app for a genesis file
func (*App) InitChainer ¶ added in v0.2.0
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer contains app specific logic for the InitChain abci call.
func (*App) InterfaceRegistry ¶ added in v0.16.0
func (app *App) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns the app's InterfaceRegistry.
func (*App) LegacyAmino ¶ added in v0.16.0
func (app *App) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns the app's amino codec.
func (*App) LoadHeight ¶
LoadHeight loads the app state for a particular height.
func (*App) ModuleAccountAddrs ¶ added in v0.2.0
ModuleAccountAddrs returns all the app's module account addresses.
func (*App) RegisterAPIRoutes ¶ added in v0.16.0
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*App) RegisterNodeService ¶ added in v0.23.0
func (*App) RegisterServices ¶ added in v0.20.0
func (app *App) RegisterServices(cfg module.Configurator)
func (*App) RegisterTendermintService ¶ added in v0.16.0
RegisterTendermintService implements the Application.RegisterTendermintService method. It registers the standard tendermint grpc endpoints on the app's grpc server.
func (*App) RegisterTxService ¶ added in v0.16.0
RegisterTxService implements the Application.RegisterTxService method. It registers transaction related endpoints on the app's grpc server.
func (App) RegisterUpgradeHandlers ¶ added in v0.19.0
func (app App) RegisterUpgradeHandlers()
func (*App) SimulationManager ¶ added in v0.8.0
func (app *App) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface.
type AuthBankGenesisBuilder ¶ added in v0.16.0
type AuthBankGenesisBuilder struct { AuthGenesis authtypes.GenesisState BankGenesis banktypes.GenesisState }
AuthBankGenesisBuilder is a tool for creating a combined auth and bank genesis state. Helper methods create basic accounts types and add them to a default genesis state. All methods return the builder so method calls can be chained together.
Example:
// create a single account genesis state builder := NewAuthBankGenesisBuilder().WithSimpleAccount(testUserAddress, testCoins) genesisState := builder.BuildMarshalled()
func NewAuthBankGenesisBuilder ¶ added in v0.16.0
func NewAuthBankGenesisBuilder() *AuthBankGenesisBuilder
NewAuthBankGenesisBuilder creates a AuthBankGenesisBuilder containing default genesis states.
func (*AuthBankGenesisBuilder) BuildMarshalled ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) BuildMarshalled(cdc codec.JSONCodec) GenesisState
BuildMarshalled assembles the final GenesisState and json encodes it into a generic genesis type.
func (*AuthBankGenesisBuilder) WithAccounts ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) WithAccounts(account ...authtypes.GenesisAccount) *AuthBankGenesisBuilder
WithAccounts adds accounts of any type to the genesis state.
func (*AuthBankGenesisBuilder) WithBalances ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) WithBalances(balance ...banktypes.Balance) *AuthBankGenesisBuilder
WithBalances adds balances to the bank genesis state. It does not check the new denom is in the genesis state denom metadata.
func (*AuthBankGenesisBuilder) WithSimpleAccount ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) WithSimpleAccount(address sdk.AccAddress, balance sdk.Coins) *AuthBankGenesisBuilder
WithSimpleAccount adds a standard account to the genesis state.
func (*AuthBankGenesisBuilder) WithSimpleModuleAccount ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) WithSimpleModuleAccount(moduleName string, balance sdk.Coins, permissions ...string) *AuthBankGenesisBuilder
WithSimpleModuleAccount adds a module account to the genesis state.
func (*AuthBankGenesisBuilder) WithSimplePeriodicVestingAccount ¶ added in v0.16.0
func (builder *AuthBankGenesisBuilder) WithSimplePeriodicVestingAccount(address sdk.AccAddress, balance sdk.Coins, periods vestingtypes.Periods, firstPeriodStartTimestamp int64) *AuthBankGenesisBuilder
WithSimplePeriodicVestingAccount adds a periodic vesting account to the genesis state.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState represents the genesis state of the blockchain. It is a map from module names to module genesis states.
func GenesisStateWithSingleValidator ¶ added in v0.23.0
func GenesisStateWithSingleValidator( app *TestApp, genesisState GenesisState, ) GenesisState
SetupWithGenesisValSet initializes GenesisState with a single validator and genesis accounts that also act as delegators.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
func NewFundedGenStateWithCoins ¶ added in v0.16.0
func NewFundedGenStateWithCoins(cdc codec.JSONCodec, coins []sdk.Coins, addresses []sdk.AccAddress) GenesisState
NewFundedGenStateWithCoins creates a (auth and bank) genesis state populated with accounts from the given addresses and coins.
func NewFundedGenStateWithSameCoins ¶ added in v0.16.0
func NewFundedGenStateWithSameCoins(cdc codec.JSONCodec, balance sdk.Coins, addresses []sdk.AccAddress) GenesisState
NewFundedGenStateWithSameCoins creates a (auth and bank) genesis state populated with accounts from the given addresses and balance.
func NewFundedGenStateWithSameCoinsWithModuleAccount ¶ added in v0.16.0
func NewFundedGenStateWithSameCoinsWithModuleAccount(cdc codec.JSONCodec, coins sdk.Coins, addresses []sdk.AccAddress, modAcc *authtypes.ModuleAccount) GenesisState
NewFundedGenStateWithSameCoinsWithModuleAccount creates a (auth and bank) genesis state populated with accounts from the given addresses and balance along with an empty module account
type Options ¶ added in v0.16.0
type Options struct { SkipLoadLatest bool SkipUpgradeHeights map[int64]bool SkipGenesisInvariants bool InvariantCheckPeriod uint MempoolEnableAuth bool MempoolAuthAddresses []sdk.AccAddress EVMTrace string EVMMaxGasWanted uint64 TelemetryOptions metricstypes.TelemetryOptions }
Options bundles several configuration params for an App.
type TallyHandler ¶ added in v0.19.0
type TallyHandler struct {
// contains filtered or unexported fields
}
TallyHandler is the tally handler for kava
func NewTallyHandler ¶ added in v0.19.0
func NewTallyHandler( gk govkeeper.Keeper, stk stakingkeeper.Keeper, svk savingskeeper.Keeper, ek earnkeeper.Keeper, lk liquidkeeper.Keeper, bk bankkeeper.Keeper, ) TallyHandler
NewTallyHandler creates a new tally handler.
type TestApp ¶ added in v0.4.1
type TestApp struct { App GenesisAddrs []sdk.AccAddress }
TestApp is a simple wrapper around an App. It exposes internal keepers for use in integration tests. This file also contains test helpers. Ideally they would be in separate package. Basic Usage:
Create a test app with NewTestApp, then all keepers and their methods can be accessed for test setup and execution.
Advanced Usage:
Some tests call for an app to be initialized with some state. This can be achieved through keeper method calls (ie keeper.SetParams(...)). However this leads to a lot of duplicated logic similar to InitGenesis methods. So TestApp.InitializeFromGenesisStates() will call InitGenesis with the default genesis state. and TestApp.InitializeFromGenesisStates(authState, cdpState) will do the same but overwrite the auth and cdp sections of the default genesis state Creating the genesis states can be combersome, but helper methods can make it easier such as NewAuthGenStateFromAccounts below.
func NewTestApp ¶ added in v0.4.1
func NewTestApp() TestApp
NewTestApp creates a new TestApp
Note, it also sets the sdk config with the app's address prefix, coin type, etc.
func NewTestAppFromSealed ¶ added in v0.15.0
func NewTestAppFromSealed() TestApp
NewTestAppFromSealed creates a TestApp without first setting sdk config.
func (TestApp) CheckBalance ¶ added in v0.4.1
func (tApp TestApp) CheckBalance(t *testing.T, ctx sdk.Context, owner sdk.AccAddress, expectedCoins sdk.Coins)
CheckBalance requires the account address has the expected amount of coins.
func (TestApp) CreateNewUnbondedValidator ¶ added in v0.20.0
func (tApp TestApp) CreateNewUnbondedValidator(ctx sdk.Context, valAddress sdk.ValAddress, selfDelegation sdkmath.Int) error
CreateNewUnbondedValidator creates a new validator in the staking module. New validators are unbonded until the end blocker is run.
func (TestApp) DeleteGenesisValidator ¶ added in v0.23.0
DeleteGenesisValidator deletes the genesis validator from the staking module. This is useful for testing with validators, but only want to consider the validators added in the test. InitGenesis requires at least 1 validator, so it must be deleted additional validators are created.
func (TestApp) DeleteGenesisValidatorCoins ¶ added in v0.23.0
func (TestApp) FundAccount ¶ added in v0.16.0
FundAccount is a utility function that funds an account by minting and sending the coins to the address.
func (TestApp) FundModuleAccount ¶ added in v0.16.0
func (tApp TestApp) FundModuleAccount(ctx sdk.Context, recipientMod string, amounts sdk.Coins) error
FundModuleAccount is a utility function that funds a module account by minting and sending the coins to the address.
func (TestApp) GetAccountKeeper ¶ added in v0.4.1
func (tApp TestApp) GetAccountKeeper() authkeeper.AccountKeeper
nolint
func (TestApp) GetAuctionKeeper ¶ added in v0.4.1
func (tApp TestApp) GetAuctionKeeper() auctionkeeper.Keeper
func (TestApp) GetBankKeeper ¶ added in v0.4.1
func (tApp TestApp) GetBankKeeper() bankkeeper.Keeper
func (TestApp) GetBep3Keeper ¶ added in v0.5.0
func (tApp TestApp) GetBep3Keeper() bep3keeper.Keeper
func (TestApp) GetCDPKeeper ¶ added in v0.4.1
func (TestApp) GetCommitteeKeeper ¶ added in v0.8.0
func (tApp TestApp) GetCommitteeKeeper() committeekeeper.Keeper
func (TestApp) GetCommunityKeeper ¶ added in v0.20.0
func (tApp TestApp) GetCommunityKeeper() communitykeeper.Keeper
func (TestApp) GetCrisisKeeper ¶ added in v0.4.1
func (tApp TestApp) GetCrisisKeeper() crisiskeeper.Keeper
func (TestApp) GetDistrKeeper ¶ added in v0.4.1
func (tApp TestApp) GetDistrKeeper() distkeeper.Keeper
func (TestApp) GetEarnKeeper ¶ added in v0.19.0
func (tApp TestApp) GetEarnKeeper() earnkeeper.Keeper
func (TestApp) GetEvmKeeper ¶ added in v0.17.0
func (TestApp) GetEvmutilKeeper ¶ added in v0.17.0
func (tApp TestApp) GetEvmutilKeeper() evmutilkeeper.Keeper
func (TestApp) GetFeeMarketKeeper ¶ added in v0.19.0
func (tApp TestApp) GetFeeMarketKeeper() feemarketkeeper.Keeper
func (TestApp) GetGovKeeper ¶ added in v0.4.1
func (TestApp) GetHardKeeper ¶ added in v0.13.0
func (tApp TestApp) GetHardKeeper() hardkeeper.Keeper
func (TestApp) GetIncentiveKeeper ¶ added in v0.8.0
func (tApp TestApp) GetIncentiveKeeper() incentivekeeper.Keeper
func (TestApp) GetIssuanceKeeper ¶ added in v0.11.0
func (tApp TestApp) GetIssuanceKeeper() issuancekeeper.Keeper
func (TestApp) GetKavadistKeeper ¶ added in v0.5.0
func (tApp TestApp) GetKavadistKeeper() kavadistkeeper.Keeper
func (TestApp) GetLiquidKeeper ¶ added in v0.19.0
func (tApp TestApp) GetLiquidKeeper() liquidkeeper.Keeper
func (TestApp) GetMintKeeper ¶ added in v0.4.1
func (tApp TestApp) GetMintKeeper() mintkeeper.Keeper
func (TestApp) GetModuleAccountBalance ¶ added in v0.20.0
func (tApp TestApp) GetModuleAccountBalance(ctx sdk.Context, moduleName string, denom string) sdkmath.Int
GetModuleAccountBalance gets the current balance of the denom for a module account
func (TestApp) GetParamsKeeper ¶ added in v0.4.1
func (tApp TestApp) GetParamsKeeper() paramskeeper.Keeper
func (TestApp) GetPriceFeedKeeper ¶ added in v0.4.1
func (tApp TestApp) GetPriceFeedKeeper() pricefeedkeeper.Keeper
func (TestApp) GetRouterKeeper ¶ added in v0.19.0
func (tApp TestApp) GetRouterKeeper() routerkeeper.Keeper
func (TestApp) GetSavingsKeeper ¶ added in v0.17.0
func (tApp TestApp) GetSavingsKeeper() savingskeeper.Keeper
func (TestApp) GetSlashingKeeper ¶ added in v0.4.1
func (tApp TestApp) GetSlashingKeeper() slashingkeeper.Keeper
func (TestApp) GetStakingKeeper ¶ added in v0.4.1
func (tApp TestApp) GetStakingKeeper() stakingkeeper.Keeper
func (TestApp) GetSwapKeeper ¶ added in v0.15.0
func (tApp TestApp) GetSwapKeeper() swapkeeper.Keeper
func (TestApp) InitializeFromGenesisStates ¶ added in v0.4.1
func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp
InitializeFromGenesisStates calls InitChain on the app using the provided genesis states. If any module genesis states are missing, defaults are used.
func (TestApp) InitializeFromGenesisStatesWithTime ¶ added in v0.11.0
func (tApp TestApp) InitializeFromGenesisStatesWithTime(genTime time.Time, genesisStates ...GenesisState) TestApp
InitializeFromGenesisStatesWithTime calls InitChain on the app using the provided genesis states and time. If any module genesis states are missing, defaults are used.
func (TestApp) InitializeFromGenesisStatesWithTimeAndChainID ¶ added in v0.11.0
func (tApp TestApp) InitializeFromGenesisStatesWithTimeAndChainID(genTime time.Time, chainID string, genesisStates ...GenesisState) TestApp
InitializeFromGenesisStatesWithTimeAndChainID calls InitChain on the app using the provided genesis states, time, and chain id. If any module genesis states are missing, defaults are used.
func (TestApp) InitializeFromGenesisStatesWithTimeAndChainIDAndHeight ¶ added in v0.17.4
func (tApp TestApp) InitializeFromGenesisStatesWithTimeAndChainIDAndHeight( genTime time.Time, chainID string, initialHeight int64, addValidator bool, genesisStates ...GenesisState, ) TestApp
InitializeFromGenesisStatesWithTimeAndChainIDAndHeight calls InitChain on the app using the provided genesis states and other parameters. If any module genesis states are missing, defaults are used.
func (TestApp) NewQueryServerTestHelper ¶ added in v0.16.0
func (tApp TestApp) NewQueryServerTestHelper(ctx sdk.Context) *baseapp.QueryServiceTestHelper
NewQueryServerTestHelper creates a new QueryServiceTestHelper that wraps the provided sdk.Context.