Documentation ¶
Index ¶
- Constants
- Variables
- func ExportStateToJSON(app *App, path string) error
- func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress)
- func GetMaccPerms() map[string][]string
- func MakeCodec() *codec.Codec
- func SetBech32AddressPrefixes(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 GenesisState
- 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) GetIncentiveKeeper() incentive.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) GetUpgradeKeeper() upgrade.Keeper
- func (tApp TestApp) GetVVKeeper() validatorvesting.Keeper
- func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp
Constants ¶
const (
Bech32MainPrefix = "jpy"
)
Variables ¶
var ( // default home directories for expected binaries DefaultCLIHome = os.ExpandEnv("$HOME/.jpycli") DefaultNodeHome = os.ExpandEnv("$HOME/.jpyd") // 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, ), 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{}, ) )
Functions ¶
func ExportStateToJSON ¶
ExportStateToJSON util function to export the app state to JSON
func GeneratePrivKeyAddressPairs ¶
func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress)
GeneratePrivKeyAddressPairsFromRand generates (deterministically) a total of n private keys and addresses. TODO only generate secp256 keys?
func GetMaccPerms ¶
GetMaccPerms returns a mapping of the application's module account permissions.
func SetBech32AddressPrefixes ¶
SetBech32AddressPrefixes sets the global prefix to be used when serializing addresses to bech32 strings.
Types ¶
type App ¶
App represents an extended ABCI application
func NewApp ¶
func NewApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, invCheckPeriod uint, 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 ¶
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 ¶
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
custom logic for app initialization
func (*App) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*App) SimulationManager ¶
func (app *App) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
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 ¶
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 TestApp ¶
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 ¶
func NewTestApp() TestApp
func (TestApp) CheckBalance ¶
func (TestApp) GetAuctionKeeper ¶
func (TestApp) GetBankKeeper ¶
func (TestApp) GetBep3Keeper ¶
func (TestApp) GetCDPKeeper ¶
func (TestApp) GetCommitteeKeeper ¶
func (TestApp) GetCrisisKeeper ¶
func (TestApp) GetDistrKeeper ¶
func (tApp TestApp) GetDistrKeeper() distribution.Keeper
func (TestApp) GetGovKeeper ¶
func (TestApp) GetIncentiveKeeper ¶
func (TestApp) GetKavadistKeeper ¶
func (TestApp) GetMintKeeper ¶
func (TestApp) GetParamsKeeper ¶
func (TestApp) GetPriceFeedKeeper ¶
func (TestApp) GetSlashingKeeper ¶
func (TestApp) GetStakingKeeper ¶
func (TestApp) GetSupplyKeeper ¶
func (TestApp) GetUpgradeKeeper ¶
func (TestApp) GetVVKeeper ¶
func (tApp TestApp) GetVVKeeper() validatorvesting.Keeper
func (TestApp) InitializeFromGenesisStates ¶
func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) TestApp
This calls InitChain on the app using the default genesis state, overwitten with any passed in genesis states