app

package
v0.0.0-...-9c82d6c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UpgradeName = "v046-to-v047"

UpgradeName defines the upgrade from v046 to v047, migrating from Cosmos SDK v0.46.x to v0.47.x.

Variables

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

	ProposalsEnabled        = "false"
	EnableSpecificProposals = ""

	DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir

	Bech32PrefixAccAddr  = Bech32Prefix
	Bech32PrefixAccPub   = Bech32Prefix + sdk.PrefixPublic
	Bech32PrefixValAddr  = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator
	Bech32PrefixValPub   = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
	Bech32PrefixConsPub  = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic

	ModuleBasics = module.NewBasicManager(getModuleBasics()...)
)

Functions

func AddTestAddrsIncremental

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

func AllCapabilities

func AllCapabilities() []string

AllCapabilities returns a list of all capabilities available with the current WasmVM. Reference: https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md Note: This functionality will be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425

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)

func GetEnabledProposals

func GetEnabledProposals() []wasm.ProposalType

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates and returns a new EncodingConfig with all modules registered.

func NewAnteHandler

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

NewAnteHandler creates a new AnteHandler for the application using the provided HandlerOptions.

func SignAndDeliverWithoutCommit

func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
	chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey) (sdk.GasInfo, *sdk.Result, error)

Types

type GenesisInitOptions

type GenesisInitOptions struct {
	ValidatorSet    *tmtypes.ValidatorSet
	GenesisAccounts []authtypes.GenesisAccount
	ChainID         string
	WasmOpts        []wasm.Option
	Balances        []banktypes.Balance
	ConsensusParams *tmproto.ConsensusParams
	GenesisModifier func(genesis GenesisState) GenesisState
}

type GenesisState

type GenesisState map[string]json.RawMessage

GenesisState represents the initial state of the blockchain, where each module's genesis data is stored as a raw JSON message, mapped by module name.

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default genesis state for the application by using the ModuleBasicManager to retrieve the default genesis for each module.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper         *keeper.Keeper
	WasmConfig        *wasmTypes.WasmConfig
	TXCounterStoreKey storetypes.StoreKey
}

HandlerOptions extends the SDK's AnteHandler options by requiring additional fields for IBC and Wasm modules.

type SetupOptions

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

type WasmApp

type WasmApp struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    *stakingkeeper.Keeper
	DistrKeeper      distrkeeper.Keeper
	GovKeeper        govkeeper.Keeper
	UpgradeKeeper    *upgradekeeper.Keeper
	WasmKeeper       wasm.Keeper
	IBCKeeper        *ibckeeper.Keeper
	TransferKeeper   ibctransferkeeper.Keeper

	// scoped keepers
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	ScopedWasmKeeper     capabilitykeeper.ScopedKeeper

	ModuleManager *module.Manager
	// contains filtered or unexported fields
}

func NewWasmApp

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

func Setup

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

func SetupWithGenesisValSet

func SetupWithGenesisValSet(t *testing.T, options *GenesisInitOptions) *WasmApp

func (*WasmApp) ExportAppStateAndValidators

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

func (*WasmApp) GetAccountKeeper

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

GetAccountKeeper returns the Account keeper instance.

func (*WasmApp) GetBankKeeper

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

GetBankKeeper returns the Bank keeper instance.

func (*WasmApp) GetBaseApp

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

GetBaseApp returns the BaseApp instance.

func (*WasmApp) GetIBCKeeper

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

GetIBCKeeper returns the IBC keeper instance.

func (*WasmApp) GetScopedIBCKeeper

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

GetScopedIBCKeeper returns the scoped IBC keeper instance for capability management.

func (*WasmApp) GetStakingKeeper

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

GetStakingKeeper returns the Staking keeper instance.

func (*WasmApp) GetWasmKeeper

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

GetWasmKeeper returns the Wasm keeper instance.

func (WasmApp) RegisterUpgradeHandlers

func (app WasmApp) RegisterUpgradeHandlers()

RegisterUpgradeHandlers registers the upgrade handlers for the application.

Directories

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

Jump to

Keyboard shortcuts

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