app

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 157 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NodeDir      = ".wasmd"
	Bech32Prefix = "wasm"
)

We pull these out so we can set them with LDFLAGS in the Makefile

View Source
var (
	// DefaultNodeHome default home directories for wasmd
	DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = Bech32Prefix
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)

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

Upgrades list of chain upgrades

Functions

func AddTestAddrsIncremental

func AddTestAddrsIncremental(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdkmath.Int) []sdk.AccAddress

AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order

func AllCapabilities deprecated

func AllCapabilities() []string

Deprecated: Use BuiltInCapabilities from github.com/CosmWasm/wasmd/x/wasm/keeper

func BlockedAddresses

func BlockedAddresses() map[string]bool

BlockedAddresses returns all the app's blocked account addresses.

func GenesisStateWithValSet

func GenesisStateWithValSet(
	codec codec.Codec,
	genesisState map[string]json.RawMessage,
	valSet *cmttypes.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

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

NOTE: This is solely to be used for testing purposes.

func MakeEncodingConfig

func MakeEncodingConfig(t testing.TB) params.EncodingConfig

MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

NewAnteHandler constructor

func NewTestNetworkFixture

func NewTestNetworkFixture() network.TestFixture

NewTestNetworkFixture returns a new WasmApp 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, blockTime time.Time, priv ...cryptotypes.PrivKey) (*abci.ResponseFinalizeBlock,
	error)

SignAndDeliverWithoutCommit signs and delivers a transaction. No commit

Types

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 *WasmApp) GenesisState

GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper             *keeper.Keeper
	WasmConfig            *wasmTypes.WasmConfig
	WasmKeeper            *wasmkeeper.Keeper
	TXCounterStoreService corestoretypes.KVStoreService
	CircuitKeeper         *circuitkeeper.Keeper
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

type SetupOptions

type SetupOptions struct {
	Logger   log.Logger
	DB       *dbm.MemDB
	AppOpts  servertypes.AppOptions
	WasmOpts []wasmkeeper.Option
}

SetupOptions defines arguments that are passed into `WasmApp` constructor.

type WasmApp

type WasmApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.BaseKeeper
	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
	NFTKeeper             nftkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	CircuitKeeper         circuitkeeper.Keeper

	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCFeeKeeper        ibcfeekeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICAHostKeeper       icahostkeeper.Keeper
	TransferKeeper      ibctransferkeeper.Keeper
	WasmKeeper          wasmkeeper.Keeper

	ScopedIBCKeeper           capabilitykeeper.ScopedKeeper
	ScopedICAHostKeeper       capabilitykeeper.ScopedKeeper
	ScopedICAControllerKeeper 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
}

WasmApp extended ABCI application

func NewWasmApp

func NewWasmApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	wasmOpts []wasmkeeper.Option,
	baseAppOptions ...func(*baseapp.BaseApp),
) *WasmApp

NewWasmApp returns a reference to an initialized WasmApp.

func NewWasmAppWithCustomOptions

func NewWasmAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *WasmApp

NewWasmAppWithCustomOptions initializes a new WasmApp with custom options.

func Setup

func Setup(t *testing.T, opts ...wasmkeeper.Option) *WasmApp

Setup initializes a new WasmApp. A Nop logger is set in WasmApp.

func SetupWithEmptyStore

func SetupWithEmptyStore(t testing.TB) *WasmApp

SetupWithEmptyStore set up a wasmd app instance with empty DB

func SetupWithGenesisValSet

func SetupWithGenesisValSet(
	t *testing.T,
	valSet *cmttypes.ValidatorSet,
	genAccs []authtypes.GenesisAccount,
	chainID string,
	opts []wasmkeeper.Option,
	balances ...banktypes.Balance,
) *WasmApp

SetupWithGenesisValSet initializes a new WasmApp 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 WasmApp from first genesis account. A Nop logger is set in WasmApp.

func (*WasmApp) AppCodec

func (app *WasmApp) 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 (*WasmApp) AutoCliOpts

func (app *WasmApp) AutoCliOpts() autocli.AppOptions

AutoCliOpts returns the autocli options for the app.

func (*WasmApp) BeginBlocker

func (app *WasmApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)

BeginBlocker application updates every begin block

func (*WasmApp) Configurator

func (a *WasmApp) Configurator() module.Configurator

func (*WasmApp) DefaultGenesis

func (a *WasmApp) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns a default genesis from the registered AppModuleBasic's.

func (*WasmApp) EndBlocker

func (app *WasmApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)

EndBlocker application updates every end block

func (*WasmApp) ExportAppStateAndValidators

func (app *WasmApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error)

ExportAppStateAndValidators exports the state of the application for a genesis file.

func (*WasmApp) GetAccountKeeper

func (app *WasmApp) GetAccountKeeper() authkeeper.AccountKeeper

func (*WasmApp) GetBankKeeper

func (app *WasmApp) GetBankKeeper() bankkeeper.Keeper

func (*WasmApp) GetBaseApp

func (app *WasmApp) GetBaseApp() *baseapp.BaseApp

func (*WasmApp) GetIBCKeeper

func (app *WasmApp) GetIBCKeeper() *ibckeeper.Keeper

func (*WasmApp) GetKey

func (app *WasmApp) 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 (*WasmApp) GetMemKey

func (app *WasmApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*WasmApp) GetScopedIBCKeeper

func (app *WasmApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper

func (*WasmApp) GetStakingKeeper

func (app *WasmApp) GetStakingKeeper() *stakingkeeper.Keeper

func (*WasmApp) GetStoreKeys

func (app *WasmApp) GetStoreKeys() []storetypes.StoreKey

GetStoreKeys returns all the stored store keys.

func (*WasmApp) GetSubspace

func (app *WasmApp) 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 (*WasmApp) GetTKey

func (app *WasmApp) 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 (*WasmApp) GetWasmKeeper

func (app *WasmApp) GetWasmKeeper() wasmkeeper.Keeper

func (*WasmApp) InitChainer

func (app *WasmApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)

InitChainer application update at chain initialization

func (*WasmApp) InterfaceRegistry

func (app *WasmApp) InterfaceRegistry() types.InterfaceRegistry

InterfaceRegistry returns WasmApp's InterfaceRegistry

func (*WasmApp) LegacyAmino

func (app *WasmApp) 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 (*WasmApp) LoadHeight

func (app *WasmApp) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*WasmApp) Name

func (app *WasmApp) Name() string

Name returns the name of the App

func (*WasmApp) PreBlocker

func (app *WasmApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)

PreBlocker application updates every pre block

func (*WasmApp) RegisterAPIRoutes

func (app *WasmApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)

RegisterAPIRoutes registers all application module routes with the provided API server.

func (*WasmApp) RegisterNodeService

func (app *WasmApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)

func (*WasmApp) RegisterTendermintService

func (app *WasmApp) RegisterTendermintService(clientCtx client.Context)

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*WasmApp) RegisterTxService

func (app *WasmApp) RegisterTxService(clientCtx client.Context)

RegisterTxService implements the Application.RegisterTxService method.

func (*WasmApp) RegisterUpgradeHandlers

func (app *WasmApp) RegisterUpgradeHandlers()

RegisterUpgradeHandlers registers the chain upgrade handlers

func (*WasmApp) SimulationManager

func (app *WasmApp) SimulationManager() *module.SimulationManager

SimulationManager implements the SimulationApp interface

func (*WasmApp) TxConfig

func (app *WasmApp) TxConfig() client.TxConfig

TxConfig returns WasmApp's TxConfig

Directories

Path Synopsis
Package params defines the simulation parameters in the gaia.
Package params defines the simulation parameters in the gaia.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL