Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureAccountPrefixes()
- func GetEnabledProposals() []wasm.ProposalType
- func GetMaccPerms() map[string][]string
- func GetSimulatorFlags()
- func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino)
- func MakeEncodingConfig() params.EncodingConfig
- func NewConfigFromFlags() simulation.Config
- func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)
- func StateFn(cdc codec.JSONMarshaler, simManager *module.SimulationManager) simtypes.AppStateFn
- func StateRandomizedFn(simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONMarshaler, ...) (json.RawMessage, []simtypes.Account)
- type App
- type GenesisState
- type SimGenesisAccount
- type StargazeApp
- func (app *StargazeApp) AppCodec() codec.Marshaler
- func (app *StargazeApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *StargazeApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *StargazeApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *StargazeApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *StargazeApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
- func (app *StargazeApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *StargazeApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *StargazeApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *StargazeApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *StargazeApp) LegacyAmino() *codec.LegacyAmino
- func (app *StargazeApp) LoadHeight(height int64) error
- func (app *StargazeApp) ModuleAccountAddrs() map[string]bool
- func (app *StargazeApp) Name() string
- func (app *StargazeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *StargazeApp) RegisterTendermintService(clientCtx client.Context)
- func (app *StargazeApp) RegisterTxService(clientCtx client.Context)
- func (app *StargazeApp) SimulationManager() *module.SimulationManager
Constants ¶
const ( // DefaultStakeDenom for Stargaze DefaultStakeDenom = "ustb" // DefaultUnbondingPeriod for Stargaze DefaultUnbondingPeriod = "504h" // Bech32MainPrefix defines the Bech32 prefix of an account's address Bech32MainPrefix = "stars" // PrefixAccount is the prefix for account keys PrefixAccount = "acc" // PrefixValidator is the prefix for validator keys PrefixValidator = "val" // PrefixConsensus is the prefix for consensus keys PrefixConsensus = "cons" // PrefixPublic is the prefix for public keys PrefixPublic = "pub" // PrefixOperator is the prefix for operator keys PrefixOperator = "oper" // PrefixAddress is the prefix for addresses PrefixAddress = "addr" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32MainPrefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = Bech32MainPrefix + PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = Bech32MainPrefix + PrefixValidator + PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = Bech32MainPrefix + PrefixValidator + PrefixOperator + PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = Bech32MainPrefix + PrefixValidator + PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = Bech32MainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic )
Variables ¶
var ( // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. ProposalsEnabled = "false" // If set to non-empty string it must be comma-separated list of values that are all a subset // of "EnableAllProposals" (takes precedence over ProposalsEnabled) EnableSpecificProposals = "" )
We pull these out so we can set them with LDFLAGS in the Makefile
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, curating.AppModuleBasic{}, user.AppModuleBasic{}, faucet.AppModuleBasic{}, stake.AppModuleBasic{}, liquidity.AppModuleBasic{}, wasm.AppModuleBasic{}, ) )
var ( FlagGenesisFileValue string FlagParamsFileValue string FlagExportParamsPathValue string FlagExportParamsHeightValue int FlagExportStatePathValue string FlagExportStatsPathValue string FlagSeedValue int64 FlagInitialBlockHeightValue int FlagNumBlocksValue int FlagBlockSizeValue int FlagLeanValue bool FlagCommitValue bool FlagOnOperationValue bool // TODO: Remove in favor of binary search for invariant violation FlagAllInvariantsValue bool FlagEnabledValue bool FlagVerboseValue bool FlagPeriodValue uint FlagGenesisTimeValue int64 )
List of available flags for the simulator
Functions ¶
func ConfigureAccountPrefixes ¶
func ConfigureAccountPrefixes()
ConfigureAccountPrefixes sets stargaze account prefixes
func GetEnabledProposals ¶
func GetEnabledProposals() []wasm.ProposalType
GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into wasmd app.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func GetSimulatorFlags ¶
func GetSimulatorFlags()
GetSimulatorFlags gets the values of all the available simulation flags
func MakeCodecs ¶
func MakeCodecs() (codec.Marshaler, *codec.LegacyAmino)
MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by simapp. It is useful for tests and clients who do not want to construct the full simapp
func MakeEncodingConfig ¶
func MakeEncodingConfig() params.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func NewConfigFromFlags ¶
func NewConfigFromFlags() simulation.Config
NewConfigFromFlags creates a simulation from the retrieved values of the flags.
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func StateFn ¶
func StateFn(cdc codec.JSONMarshaler, simManager *module.SimulationManager) simtypes.AppStateFn
StateFn returns the initial application state using a genesis or the simulation parameters. It panics if the user provides files for both of them. If a file is not given for the genesis or the sim params, it creates a randomized one.
func StateRandomizedFn ¶
func StateRandomizedFn( simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONMarshaler, accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, ) (json.RawMessage, []simtypes.Account)
StateRandomizedFn creates calls each module's GenesisState generator function and creates the simulation params
Types ¶
type App ¶
type App interface { // The assigned name of the app. Name() string // The application types codec. // NOTE: This shoult be sealed before being returned. LegacyAmino() *codec.LegacyAmino // Application updates every begin block. BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock // Application updates every end block. EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock // Application update at chain (i.e app) initialization. InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain // Loads the app at a given height. LoadHeight(height int64) error // Exports the state of the application for a genesis file. ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) // All the registered module account addreses. ModuleAccountAddrs() map[string]bool // Helper for the simulation framework. SimulationManager() *module.SimulationManager }
App implements the common methods for a Cosmos SDK-based application specific blockchain.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState is the genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
type SimGenesisAccount ¶
type SimGenesisAccount struct { *authtypes.BaseAccount // vesting account fields OriginalVesting sdk.Coins `json:"original_vesting" yaml:"original_vesting"` // total vesting coins upon initialization // delegated vested coins at time of delegation DelegatedFree sdk.Coins `json:"delegated_free" yaml:"delegated_free"` // delegated vesting coins at time of delegation DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // vesting start time (UNIX Epoch time) StartTime int64 `json:"start_time" yaml:"start_time"` EndTime int64 `json:"end_time" yaml:"end_time"` // name of the module account ModuleName string `json:"module_name" yaml:"module_name"` // permissions of module account ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` }
SimGenesisAccount defines a type that implements the GenesisAccount interface to be used for simulation accounts in the genesis state.
func (SimGenesisAccount) Validate ¶
func (sga SimGenesisAccount) Validate() error
Validate checks for errors on the vesting and module account parameters
type StargazeApp ¶
type StargazeApp struct { *baseapp.BaseApp // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper // Stargaze Keepers CuratingKeeper curatingkeeper.Keeper UserKeeper userkeeper.Keeper FaucetKeeper faucet.Keeper StakeKeeper stakekeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper // third party keepers LiquidityKeeper liquiditykeeper.Keeper // contains filtered or unexported fields }
StargazeApp extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.
func NewStargazeApp ¶
func NewStargazeApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, enabledProposals []wasm.ProposalType, encodingConfig stargazeappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *StargazeApp
NewStargazeApp returns a reference to an initialized Gaia.
func (*StargazeApp) AppCodec ¶
func (app *StargazeApp) AppCodec() codec.Marshaler
AppCodec returns Gaia's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*StargazeApp) BeginBlocker ¶
func (app *StargazeApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*StargazeApp) EndBlocker ¶
func (app *StargazeApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*StargazeApp) ExportAppStateAndValidators ¶
func (app *StargazeApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*StargazeApp) GetKey ¶
func (app *StargazeApp) GetKey(storeKey string) *sdk.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*StargazeApp) GetMemKey ¶
func (app *StargazeApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*StargazeApp) GetSubspace ¶
func (app *StargazeApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*StargazeApp) GetTKey ¶
func (app *StargazeApp) GetTKey(storeKey string) *sdk.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*StargazeApp) InitChainer ¶
func (app *StargazeApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*StargazeApp) InterfaceRegistry ¶
func (app *StargazeApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns Gaia's InterfaceRegistry
func (*StargazeApp) LegacyAmino ¶
func (app *StargazeApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns SimApp's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*StargazeApp) LoadHeight ¶
func (app *StargazeApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*StargazeApp) ModuleAccountAddrs ¶
func (app *StargazeApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*StargazeApp) RegisterAPIRoutes ¶
func (app *StargazeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*StargazeApp) RegisterTendermintService ¶
func (app *StargazeApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*StargazeApp) RegisterTxService ¶
func (app *StargazeApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*StargazeApp) SimulationManager ¶
func (app *StargazeApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface