Documentation ¶
Index ¶
- Constants
- Variables
- func BlockedAddresses() map[string]bool
- func GetMaccPerms() map[string][]string
- func NewPOBAnteHandler(options POBHandlerOptions) sdk.AnteHandler
- type POBHandlerOptions
- type TestApp
- func (app *TestApp) AppCodec() codec.Codec
- func (app *TestApp) CheckTx(req cometabci.RequestCheckTx) cometabci.ResponseCheckTx
- func (app *TestApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *TestApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *TestApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *TestApp) InterfaceRegistry() codectypes.InterfaceRegistry
- func (app *TestApp) LegacyAmino() *codec.LegacyAmino
- func (app *TestApp) Name() string
- func (app *TestApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *TestApp) SetCheckTx(handler abci.CheckTx)
- func (app *TestApp) SimulationManager() *module.SimulationManager
- func (app *TestApp) TxConfig() client.TxConfig
Constants ¶
const (
ChainID = "chain-id-0"
)
Variables ¶
var ( BondDenom = sdk.DefaultBondDenom // 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.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, groupmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, nftmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, buildermodule.AppModuleBasic{}, ) )
var ( // application configuration (used by depinject) AppConfig = appconfig.Compose(&appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { Name: "runtime", Config: appconfig.WrapAny(&runtimev1alpha1.Module{ AppName: "TestApp", BeginBlockers: []string{ upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, buildertypes.ModuleName, consensustypes.ModuleName, }, EndBlockers: []string{ crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, consensustypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, buildertypes.ModuleName, }, OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ { ModuleName: authtypes.ModuleName, KvStoreKey: "acc", }, }, InitGenesis: genesisModuleOrder, }), }, { Name: authtypes.ModuleName, Config: appconfig.WrapAny(&authmodulev1.Module{ Bech32Prefix: "cosmos", ModuleAccountPermissions: moduleAccPerms, }), }, { Name: vestingtypes.ModuleName, Config: appconfig.WrapAny(&vestingmodulev1.Module{}), }, { Name: banktypes.ModuleName, Config: appconfig.WrapAny(&bankmodulev1.Module{ BlockedModuleAccountsOverride: blockAccAddrs, }), }, { Name: stakingtypes.ModuleName, Config: appconfig.WrapAny(&stakingmodulev1.Module{}), }, { Name: slashingtypes.ModuleName, Config: appconfig.WrapAny(&slashingmodulev1.Module{}), }, { Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, { Name: "tx", Config: appconfig.WrapAny(&txconfigv1.Config{}), }, { Name: genutiltypes.ModuleName, Config: appconfig.WrapAny(&genutilmodulev1.Module{}), }, { Name: authz.ModuleName, Config: appconfig.WrapAny(&authzmodulev1.Module{}), }, { Name: upgradetypes.ModuleName, Config: appconfig.WrapAny(&upgrademodulev1.Module{}), }, { Name: distrtypes.ModuleName, Config: appconfig.WrapAny(&distrmodulev1.Module{}), }, { Name: capabilitytypes.ModuleName, Config: appconfig.WrapAny(&capabilitymodulev1.Module{ SealKeeper: true, }), }, { Name: evidencetypes.ModuleName, Config: appconfig.WrapAny(&evidencemodulev1.Module{}), }, { Name: minttypes.ModuleName, Config: appconfig.WrapAny(&mintmodulev1.Module{}), }, { Name: group.ModuleName, Config: appconfig.WrapAny(&groupmodulev1.Module{ MaxExecutionPeriod: durationpb.New(time.Second * 1209600), MaxMetadataLen: 255, }), }, { Name: feegrant.ModuleName, Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), }, { Name: govtypes.ModuleName, Config: appconfig.WrapAny(&govmodulev1.Module{}), }, { Name: crisistypes.ModuleName, Config: appconfig.WrapAny(&crisismodulev1.Module{}), }, { Name: consensustypes.ModuleName, Config: appconfig.WrapAny(&consensusmodulev1.Module{}), }, { Name: buildertypes.ModuleName, Config: appconfig.WrapAny(&buildermodulev1.Module{}), }, }, }) )
Functions ¶
func BlockedAddresses ¶
BlockedAddresses returns all the app's blocked account addresses.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
NOTE: This is solely to be used for testing purposes.
func NewPOBAnteHandler ¶
func NewPOBAnteHandler(options POBHandlerOptions) sdk.AnteHandler
NewPOBAnteHandler wraps all of the default Cosmos SDK AnteDecorators with the POB AnteHandler.
Types ¶
type POBHandlerOptions ¶
type POBHandlerOptions struct { BaseOptions ante.HandlerOptions Mempool mempool.Mempool TxDecoder sdk.TxDecoder TxEncoder sdk.TxEncoder BuilderKeeper builderkeeper.Keeper }
type TestApp ¶
type TestApp struct { *runtime.App // 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 AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper GroupKeeper groupkeeper.Keeper ConsensusParamsKeeper consensuskeeper.Keeper BuilderKeeper builderkeeper.Keeper // contains filtered or unexported fields }
func (*TestApp) AppCodec ¶
AppCodec returns SimApp'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 (*TestApp) CheckTx ¶ added in v1.0.1
func (app *TestApp) CheckTx(req cometabci.RequestCheckTx) cometabci.ResponseCheckTx
CheckTx will check the transaction with the provided checkTxHandler. We override the default handler so that we can verify bid transactions before they are inserted into the mempool. With the POB CheckTx, we can verify the bid transaction and all of the bundled transactions before inserting the bid transaction into the mempool.
func (*TestApp) ExportAppStateAndValidators ¶
func (app *TestApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*TestApp) GetKey ¶
func (app *TestApp) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*TestApp) GetSubspace ¶
func (app *TestApp) 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 (*TestApp) InterfaceRegistry ¶
func (app *TestApp) InterfaceRegistry() codectypes.InterfaceRegistry
InterfaceRegistry returns SimApp's InterfaceRegistry
func (*TestApp) LegacyAmino ¶
func (app *TestApp) 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 (*TestApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*TestApp) SetCheckTx ¶ added in v1.0.1
SetCheckTx sets the checkTxHandler for the app.
func (*TestApp) SimulationManager ¶
func (app *TestApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface