Documentation ¶
Index ¶
- Constants
- Variables
- func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress)
- func GetMaccPerms() map[string][]string
- func MakeCodec() *codec.Codec
- func RegisterSimulateRoutes(cliCtx context.CLIContext, r *mux.Router)
- func SetBech32AddressPrefixes(config *sdk.Config)
- func SetBip44CoinType(config *sdk.Config)
- type App
- func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *App) BlacklistedAccAddrs() map[string]bool
- func (app *App) Codec() *codec.Codec
- func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)
- func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *App) LoadHeight(height int64) error
- func (app *App) ModuleAccountAddrs() map[string]bool
- func (app *App) SimulationManager() *module.SimulationManager
- type AppOptions
- type AuthGenesisBuilder
- func (builder AuthGenesisBuilder) Build() auth.GenesisState
- func (builder AuthGenesisBuilder) BuildMarshalled() GenesisState
- func (builder AuthGenesisBuilder) WithAccounts(account ...authexported.GenesisAccount) AuthGenesisBuilder
- func (builder AuthGenesisBuilder) WithEmptyValidatorVestingAccount(address sdk.AccAddress) AuthGenesisBuilder
- func (builder AuthGenesisBuilder) WithSimpleAccount(address sdk.AccAddress, balance sdk.Coins) AuthGenesisBuilder
- func (builder AuthGenesisBuilder) WithSimpleModuleAccount(moduleName string, balance sdk.Coins, permissions ...string) AuthGenesisBuilder
- func (builder AuthGenesisBuilder) WithSimplePeriodicVestingAccount(address sdk.AccAddress, balance sdk.Coins, periods vesting.Periods, ...) AuthGenesisBuilder
- type GenesisState
- type SimulateRequest
- type TestApp
- func (tApp TestApp) CheckBalance(t *testing.T, ctx sdk.Context, owner sdk.AccAddress, expectedCoins sdk.Coins)
- func (tApp TestApp) GetAccountKeeper() auth.AccountKeeper
- func (tApp TestApp) GetAuctionKeeper() auction.Keeper
- func (tApp TestApp) GetBankKeeper() bank.Keeper
- func (tApp TestApp) GetBep3Keeper() bep3.Keeper
- func (tApp TestApp) GetCDPKeeper() cdp.Keeper
- func (tApp TestApp) GetCommitteeKeeper() committee.Keeper
- func (tApp TestApp) GetCrisisKeeper() crisis.Keeper
- func (tApp TestApp) GetDistrKeeper() distribution.Keeper
- func (tApp TestApp) GetGovKeeper() gov.Keeper
- func (tApp TestApp) GetHardKeeper() hard.Keeper
- func (tApp TestApp) GetIncentiveKeeper() incentive.Keeper
- func (tApp TestApp) GetIssuanceKeeper() issuance.Keeper
- func (tApp TestApp) GetKavadistKeeper() kavadist.Keeper
- func (tApp TestApp) GetMintKeeper() mint.Keeper
- func (tApp TestApp) GetParamsKeeper() params.Keeper
- func (tApp TestApp) GetPriceFeedKeeper() pricefeed.Keeper
- func (tApp TestApp) GetSlashingKeeper() slashing.Keeper
- func (tApp TestApp) GetStakingKeeper() staking.Keeper
- func (tApp TestApp) GetSupplyKeeper() supply.Keeper
- func (tApp TestApp) GetSwapKeeper() swap.Keeper
- func (tApp TestApp) GetUpgradeKeeper() upgrade.Keeper
- func (tApp TestApp) GetVVKeeper() validatorvesting.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
Constants ¶
const ( Bech32MainPrefix = "kava" Bip44CoinType = 459 // see https://github.com/satoshilabs/slips/blob/master/slip-0044.md )
Variables ¶
var ( // default home directories for expected binaries DefaultCLIHome = os.ExpandEnv("$HOME/.kvcli") DefaultNodeHome = os.ExpandEnv("$HOME/.kvd") // 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{}, validatorvesting.AppModuleBasic{}, bank.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distr.ProposalHandler, committee.ProposalHandler, upgradeclient.ProposalHandler, kavadist.ProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, upgrade.AppModuleBasic{}, supply.AppModuleBasic{}, evidence.AppModuleBasic{}, auction.AppModuleBasic{}, cdp.AppModuleBasic{}, pricefeed.AppModuleBasic{}, committee.AppModuleBasic{}, bep3.AppModuleBasic{}, kavadist.AppModuleBasic{}, incentive.AppModuleBasic{}, issuance.AppModuleBasic{}, hard.AppModuleBasic{}, swap.AppModuleBasic{}, ) )
Functions ¶
func GeneratePrivKeyAddressPairs ¶ added in v0.4.1
func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress)
GeneratePrivKeyAddressPairsFromRand generates (deterministically) a total of n secp256k1 private keys and addresses.
func GetMaccPerms ¶ added in v0.3.0
GetMaccPerms returns a mapping of the application's module account permissions.
func RegisterSimulateRoutes ¶ added in v0.15.1
func RegisterSimulateRoutes(cliCtx context.CLIContext, r *mux.Router)
RegisterSimulateRoutes registers a tx simulate route to a mux router with a provided cli context
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.
Types ¶
type App ¶
App represents an extended ABCI application
func NewApp ¶
func NewApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts AppOptions, baseAppOptions ...func(*bam.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
application updates every end block
func (*App) BlacklistedAccAddrs ¶ added in v0.8.0
BlacklistedAccAddrs returns all the app's module account addresses black listed for receiving tokens.
func (*App) EndBlocker ¶
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
application updates every end block
func (*App) ExportAppStateAndValidators ¶
func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string, ) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err 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
custom logic for app initialization
func (*App) ModuleAccountAddrs ¶ added in v0.2.0
ModuleAccountAddrs returns all the app's module account addresses.
func (*App) SimulationManager ¶ added in v0.8.0
func (app *App) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type AppOptions ¶ added in v0.12.1
type AppOptions struct { SkipLoadLatest bool SkipUpgradeHeights map[int64]bool InvariantCheckPeriod uint MempoolEnableAuth bool MempoolAuthAddresses []sdk.AccAddress }
AppOptions bundles several configuration params for an App. The zero value can be used as a sensible default.
type AuthGenesisBuilder ¶ added in v0.15.0
type AuthGenesisBuilder struct {
auth.GenesisState
}
AuthGenesisBuilder is a tool for creating an auth genesis state. Helper methods create basic accounts types and add them to a default genesis state. All methods are immutable and return updated copies of the builder. The builder inherits from auth.GenesisState, so fields can be accessed directly if a helper method doesn't exist.
Example:
// create a single account genesis state builder := NewAuthGenesisBuilder().WithSimpleAccount(testUserAddress, testCoins) genesisState := builder.Build()
func NewAuthGenesisBuilder ¶ added in v0.15.0
func NewAuthGenesisBuilder() AuthGenesisBuilder
NewAuthGenesisBuilder creates a AuthGenesisBuilder containing a default genesis state.
func (AuthGenesisBuilder) Build ¶ added in v0.15.0
func (builder AuthGenesisBuilder) Build() auth.GenesisState
Build assembles and returns the final GenesisState
func (AuthGenesisBuilder) BuildMarshalled ¶ added in v0.15.0
func (builder AuthGenesisBuilder) BuildMarshalled() GenesisState
BuildMarshalled assembles the final GenesisState and json encodes it into a generic genesis type.
func (AuthGenesisBuilder) WithAccounts ¶ added in v0.15.0
func (builder AuthGenesisBuilder) WithAccounts(account ...authexported.GenesisAccount) AuthGenesisBuilder
WithAccounts adds accounts of any type to the genesis state.
func (AuthGenesisBuilder) WithEmptyValidatorVestingAccount ¶ added in v0.15.0
func (builder AuthGenesisBuilder) WithEmptyValidatorVestingAccount(address sdk.AccAddress) AuthGenesisBuilder
WithEmptyValidatorVestingAccount adds a stub validator vesting account to the genesis state.
func (AuthGenesisBuilder) WithSimpleAccount ¶ added in v0.15.0
func (builder AuthGenesisBuilder) WithSimpleAccount(address sdk.AccAddress, balance sdk.Coins) AuthGenesisBuilder
WithSimpleAccount adds a standard account to the genesis state.
func (AuthGenesisBuilder) WithSimpleModuleAccount ¶ added in v0.15.0
func (builder AuthGenesisBuilder) WithSimpleModuleAccount(moduleName string, balance sdk.Coins, permissions ...string) AuthGenesisBuilder
WithSimpleModuleAccount adds a module account to the genesis state.
func (AuthGenesisBuilder) WithSimplePeriodicVestingAccount ¶ added in v0.15.0
func (builder AuthGenesisBuilder) WithSimplePeriodicVestingAccount(address sdk.AccAddress, balance sdk.Coins, periods vesting.Periods, firstPeriodStartTimestamp int64) AuthGenesisBuilder
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 NewAuthGenState ¶ added in v0.4.1
func NewAuthGenState(addresses []sdk.AccAddress, coins []sdk.Coins) GenesisState
Create a new auth genesis state from some addresses and coins. The state is returned marshalled into a map.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
type SimulateRequest ¶ added in v0.15.1
type SimulateRequest struct { Msgs []sdk.Msg `json:"msgs"` Fee auth.StdFee `json:"fee"` Memo string `json:"memo"` }
SimulateRequest represents attributes of a tx that will be simulated
type TestApp ¶ added in v0.4.1
type TestApp struct {
App
}
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
func NewTestAppFromSealed ¶ added in v0.15.0
func NewTestAppFromSealed() TestApp
func (TestApp) CheckBalance ¶ added in v0.4.1
func (TestApp) GetAccountKeeper ¶ added in v0.4.1
func (tApp TestApp) GetAccountKeeper() auth.AccountKeeper
nolint
func (TestApp) GetAuctionKeeper ¶ added in v0.4.1
func (TestApp) GetBankKeeper ¶ added in v0.4.1
func (TestApp) GetBep3Keeper ¶ added in v0.5.0
func (TestApp) GetCDPKeeper ¶ added in v0.4.1
func (TestApp) GetCommitteeKeeper ¶ added in v0.8.0
func (TestApp) GetCrisisKeeper ¶ added in v0.4.1
func (TestApp) GetDistrKeeper ¶ added in v0.4.1
func (tApp TestApp) GetDistrKeeper() distribution.Keeper
func (TestApp) GetGovKeeper ¶ added in v0.4.1
func (TestApp) GetHardKeeper ¶ added in v0.13.0
func (TestApp) GetIncentiveKeeper ¶ added in v0.8.0
func (TestApp) GetIssuanceKeeper ¶ added in v0.11.0
func (TestApp) GetKavadistKeeper ¶ added in v0.5.0
func (TestApp) GetMintKeeper ¶ added in v0.4.1
func (TestApp) GetParamsKeeper ¶ added in v0.4.1
func (TestApp) GetPriceFeedKeeper ¶ added in v0.4.1
func (TestApp) GetSlashingKeeper ¶ added in v0.4.1
func (TestApp) GetStakingKeeper ¶ added in v0.4.1
func (TestApp) GetSupplyKeeper ¶ added in v0.4.1
func (TestApp) GetSwapKeeper ¶ added in v0.15.0
func (TestApp) GetUpgradeKeeper ¶ added in v0.8.0
func (TestApp) GetVVKeeper ¶ added in v0.4.1
func (tApp TestApp) GetVVKeeper() validatorvesting.Keeper
func (TestApp) InitializeFromGenesisStates ¶ added in v0.4.1
func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp
InitializeFromGenesisStates calls InitChain on the app using the default genesis state, overwitten with any passed in genesis states
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 default genesis state, overwitten with any passed in genesis states and genesis Time
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 default genesis state, overwitten with any passed in genesis states and genesis Time