Documentation ¶
Index ¶
- Constants
- Variables
- func BlockedAddresses() map[string]bool
- func CreateLanes(app *TestApp) (*mevlane.MEVLane, *base.BaseLane, *base.BaseLane)
- func GetMaccPerms() map[string][]string
- func NewBSDKAnteHandler(options BSDKHandlerOptions) sdk.AnteHandler
- type BSDKHandlerOptions
- type TestApp
- func (app *TestApp) AppCodec() codec.Codec
- func (app *TestApp) ChainID() string
- 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) RegisterTxService(clientCtx client.Context)
- func (app *TestApp) SetCheckTx(handler checktx.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{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, }, ), params.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, groupmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, nftmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, auctionmodule.AppModuleBasic{}, feegrantmodule.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, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, auctiontypes.ModuleName, consensustypes.ModuleName, }, EndBlockers: []string{ govtypes.ModuleName, stakingtypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, evidencetypes.ModuleName, feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, consensustypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, auctiontypes.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: 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: consensustypes.ModuleName, Config: appconfig.WrapAny(&consensusmodulev1.Module{}), }, { Name: auctiontypes.ModuleName, Config: appconfig.WrapAny(&auctionmodulev1.Module{}), }, }, }) )
Functions ¶
func BlockedAddresses ¶
BlockedAddresses returns all the app's blocked account addresses.
func CreateLanes ¶ added in v1.3.0
CreateLanes walks through the process of creating the lanes for the block sdk. In this function we create three separate lanes - MEV, Free, and Default - and then return them.
NOTE: Application Developers should closely replicate this function in their own application.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
NOTE: This is solely to be used for testing purposes.
func NewBSDKAnteHandler ¶ added in v1.1.0
func NewBSDKAnteHandler(options BSDKHandlerOptions) sdk.AnteHandler
NewBSDKAnteHandler wraps all of the default Cosmos SDK AnteDecorators with the custom block-sdk AnteHandlers.
Types ¶
type BSDKHandlerOptions ¶ added in v1.1.0
type BSDKHandlerOptions struct { BaseOptions ante.HandlerOptions MEVLane auctionante.MEVLane TxDecoder sdk.TxDecoder TxEncoder sdk.TxEncoder FreeLane block.Lane // contains filtered or unexported fields }
type TestApp ¶
type TestApp struct { *runtime.App // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper StakingKeeper *stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper *govkeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper GroupKeeper groupkeeper.Keeper ConsensusParamsKeeper consensuskeeper.Keeper Auctionkeeper auctionkeeper.Keeper FeeGrantKeeper feegrantkeeper.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) ChainID ¶
ChainID gets chainID from private fields of BaseApp Should be removed once SDK 0.50.x will be adopted
func (*TestApp) CheckTx ¶
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) RegisterTxService ¶ added in v1.3.0
RegisterTxService implements the Application.RegisterTxService method.
func (*TestApp) SetCheckTx ¶
SetCheckTx sets the checkTxHandler for the app.
func (*TestApp) SimulationManager ¶
func (app *TestApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface