Documentation ¶
Index ¶
- Variables
- func AddTestAddrs(app *ConsumerApp, ctx sdk.Context, accNum int, accAmt math.Int) ([]sdk.AccAddress, error)
- func AllCapabilities() []string
- func BlockedAddresses() map[string]bool
- func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func GetMaccPerms() map[string][]string
- func ModuleAccountAddrs() map[string]bool
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewTestNetworkFixture() network.TestFixture
- func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, ...) (sdk.GasInfo, *sdk.Result, error)
- func TestAppOptions() simsutils.AppOptionsMap
- type ConsumerApp
- func NewAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *ConsumerApp
- func NewConsumerApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *ConsumerApp
- func NewTmpApp() *ConsumerApp
- func Setup(t *testing.T, opts ...wasmkeeper.Option) *ConsumerApp
- func SetupWithEmptyStore(t testing.TB) *ConsumerApp
- func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, ...) *ConsumerApp
- func (app *ConsumerApp) AppCodec() codec.Codec
- func (app *ConsumerApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *ConsumerApp) Configurator() module.Configurator
- func (app *ConsumerApp) DefaultGenesis() map[string]json.RawMessage
- func (app *ConsumerApp) EncodingConfig() *appparams.EncodingConfig
- func (app *ConsumerApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *ConsumerApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *ConsumerApp) GetAccountKeeper() authkeeper.AccountKeeper
- func (app *ConsumerApp) GetBankKeeper() bankkeeper.Keeper
- func (app *ConsumerApp) GetBaseApp() *baseapp.BaseApp
- func (app *ConsumerApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *ConsumerApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *ConsumerApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *ConsumerApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
- func (app *ConsumerApp) GetStakingKeeper() *stakingkeeper.Keeper
- func (app *ConsumerApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *ConsumerApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *ConsumerApp) GetWasmKeeper() wasmkeeper.Keeper
- func (app *ConsumerApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *ConsumerApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *ConsumerApp) LegacyAmino() *codec.LegacyAmino
- func (app *ConsumerApp) LoadHeight(height int64) error
- func (app *ConsumerApp) Name() string
- func (app *ConsumerApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *ConsumerApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *ConsumerApp) RegisterTendermintService(clientCtx client.Context)
- func (app *ConsumerApp) RegisterTxService(clientCtx client.Context)
- func (app *ConsumerApp) SimulationManager() *module.SimulationManager
- func (app *ConsumerApp) TxConfig() client.TxConfig
- type GenesisState
- type HandlerOptions
- type SetupOptions
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultNodeHome default home directories for wasmd DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir )
These constants are derived from the above variables. These are the ones we will want to use in the code, based on any overrides above
var (
NodeDir = ".bcd"
)
We pull these out so we can set them with LDFLAGS in the Makefile
Functions ¶
func AddTestAddrs ¶
func AddTestAddrs(app *ConsumerApp, ctx sdk.Context, accNum int, accAmt math.Int) ([]sdk.AccAddress, error)
AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func AllCapabilities ¶
func AllCapabilities() []string
AllCapabilities returns all capabilities available with the current wasmvm See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md This functionality is going to be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425
func BlockedAddresses ¶
BlockedAddresses returns all the app's blocked account addresses.
func GenesisStateWithValSet ¶
func GenesisStateWithValSet( codec codec.Codec, genesisState map[string]json.RawMessage, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (map[string]json.RawMessage, error)
GenesisStateWithValSet returns a new genesis state with the validator set copied from simtestutil with delegation not added to supply
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
NOTE: This is solely to be used for testing purposes.
func ModuleAccountAddrs ¶
ModuleAccountAddrs provides a list of blocked module accounts from configuration in AppConfig
Ported from ConsumerApp
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func NewTestNetworkFixture ¶
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new ConsumerApp AppConstructor for network simulation tests
func SignAndDeliverWithoutCommit ¶
func SignAndDeliverWithoutCommit( t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, fees sdk.Coins, chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey, ) (sdk.GasInfo, *sdk.Result, error)
SignAndDeliverWithoutCommit signs and delivers a transaction. No commit
func TestAppOptions ¶
func TestAppOptions() simsutils.AppOptionsMap
TestAppOptions returns an app option with tmp dir and btc network
Types ¶
type ConsumerApp ¶
type ConsumerApp 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 AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly IBCFeeKeeper ibcfeekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper WasmKeeper wasmkeeper.Keeper BabylonKeeper *bbnkeeper.Keeper ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper // the module manager ModuleManager *module.Manager BasicModuleManager module.BasicManager // contains filtered or unexported fields }
ConsumerApp extended ABCI application
func NewAppWithCustomOptions ¶
func NewAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *ConsumerApp
NewAppWithCustomOptions initializes a new ConsumerApp with custom options.
func NewConsumerApp ¶
func NewConsumerApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *ConsumerApp
NewConsumerApp returns a reference to an initialized ConsumerApp.
func NewTmpApp ¶
func NewTmpApp() *ConsumerApp
func Setup ¶
func Setup(t *testing.T, opts ...wasmkeeper.Option) *ConsumerApp
Setup initializes a new ConsumerApp. A Nop logger is set in ConsumerApp.
func SetupWithEmptyStore ¶
func SetupWithEmptyStore(t testing.TB) *ConsumerApp
SetupWithEmptyStore set up a wasmd app instance with empty DB
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasmkeeper.Option, balances ...banktypes.Balance) *ConsumerApp
SetupWithGenesisValSet initializes a new ConsumerApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the ConsumerApp from first genesis account. A Nop logger is set in ConsumerApp.
func (*ConsumerApp) AppCodec ¶
func (app *ConsumerApp) AppCodec() codec.Codec
AppCodec returns 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 (*ConsumerApp) BeginBlocker ¶
func (app *ConsumerApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker application updates every begin block
func (*ConsumerApp) Configurator ¶
func (app *ConsumerApp) Configurator() module.Configurator
func (*ConsumerApp) DefaultGenesis ¶
func (app *ConsumerApp) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*ConsumerApp) EncodingConfig ¶
func (app *ConsumerApp) EncodingConfig() *appparams.EncodingConfig
func (*ConsumerApp) EndBlocker ¶
EndBlocker application updates every end block
func (*ConsumerApp) ExportAppStateAndValidators ¶
func (app *ConsumerApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*ConsumerApp) GetAccountKeeper ¶
func (app *ConsumerApp) GetAccountKeeper() authkeeper.AccountKeeper
func (*ConsumerApp) GetBankKeeper ¶
func (app *ConsumerApp) GetBankKeeper() bankkeeper.Keeper
func (*ConsumerApp) GetBaseApp ¶
func (app *ConsumerApp) GetBaseApp() *baseapp.BaseApp
func (*ConsumerApp) GetIBCKeeper ¶
func (app *ConsumerApp) GetIBCKeeper() *ibckeeper.Keeper
func (*ConsumerApp) GetKey ¶
func (app *ConsumerApp) 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 (*ConsumerApp) GetMemKey ¶
func (app *ConsumerApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*ConsumerApp) GetScopedIBCKeeper ¶
func (app *ConsumerApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper
func (*ConsumerApp) GetStakingKeeper ¶
func (app *ConsumerApp) GetStakingKeeper() *stakingkeeper.Keeper
func (*ConsumerApp) GetSubspace ¶
func (app *ConsumerApp) 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 (*ConsumerApp) GetTKey ¶
func (app *ConsumerApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*ConsumerApp) GetWasmKeeper ¶
func (app *ConsumerApp) GetWasmKeeper() wasmkeeper.Keeper
func (*ConsumerApp) InitChainer ¶
func (app *ConsumerApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*ConsumerApp) InterfaceRegistry ¶
func (app *ConsumerApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns ConsumerApp's InterfaceRegistry
func (*ConsumerApp) LegacyAmino ¶
func (app *ConsumerApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns legacy 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 (*ConsumerApp) LoadHeight ¶
func (app *ConsumerApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*ConsumerApp) RegisterAPIRoutes ¶
func (app *ConsumerApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*ConsumerApp) RegisterNodeService ¶
func (app *ConsumerApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
func (*ConsumerApp) RegisterTendermintService ¶
func (app *ConsumerApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*ConsumerApp) RegisterTxService ¶
func (app *ConsumerApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*ConsumerApp) SimulationManager ¶
func (app *ConsumerApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
func (*ConsumerApp) TxConfig ¶
func (app *ConsumerApp) TxConfig() client.TxConfig
TxConfig returns ConsumerApp's TxConfig
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState 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 GenesisStateWithSingleValidator ¶
func GenesisStateWithSingleValidator(t *testing.T, app *ConsumerApp) GenesisState
GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type HandlerOptions ¶
type HandlerOptions struct { ante.HandlerOptions IBCKeeper *keeper.Keeper WasmConfig *wasmTypes.WasmConfig TXCounterStoreKey storetypes.StoreKey }
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.
type SetupOptions ¶
type SetupOptions struct { Logger log.Logger DB *dbm.MemDB InvCheckPeriod uint SkipUpgradeHeights map[int64]bool AppOpts servertypes.AppOptions }
SetupOptions defines arguments that are passed into `Simapp` constructor.