app

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 133 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals.
	// If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals.
	ProposalsEnabled = "true"
	// If set to non-empty string it must be comma-separated list of values that are all a subset
	// of "EnableAllProposals" (takes precedence over ProposalsEnabled)
	// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
	EnableSpecificProposals = ""
)
View Source
var (
	// 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.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		staking.AppModuleBasic{},
		mint.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()...),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		ibc.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{},
		vesting.AppModuleBasic{},
		packetforward.AppModuleBasic{},
		fantoken.AppModuleBasic{},
		merkledrop.AppModuleBasic{},
		wasm.AppModuleBasic{},
	)
)
View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.BlockParams{
		MaxBytes: 200000,
		MaxGas:   2000000,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in SimApp testing.

Functions

func CheckBalance added in v0.14.0

func CheckBalance(t *testing.T, app *BitsongApp, addr sdk.AccAddress, balances sdk.Coins)

func CreateTestPubKeys added in v0.14.0

func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey

func DefaultConfig added in v0.11.0

func DefaultConfig() network.Config

DefaultConfig returns a default configuration suitable for nearly all testing requirements.

func GetEnabledProposals added in v0.13.0

func GetEnabledProposals() []wasm.ProposalType

GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into wasmd app.

func GetWasmOpts added in v0.13.0

func GetWasmOpts(appOpts servertypes.AppOptions) []wasm.Option

func MakeEncodingConfig added in v0.8.0

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewAnteHandler added in v0.10.0

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

func NewAppConstructor added in v0.11.0

func NewAppConstructor(encodingCfg params.EncodingConfig) network.AppConstructor

func RegisterSwaggerAPI added in v0.8.0

func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func SignCheckDeliver added in v0.14.0

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

SignCheckDeliver checks a generated signed transaction and simulates a block commitment with the given transaction. A test assertion is made using the parameter 'expPass' against the result. A corresponding result is returned.

Types

type BitsongApp added in v0.11.0

type BitsongApp 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
	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	IBCFeeKeeper        ibcfeekeeper.Keeper
	EvidenceKeeper      evidencekeeper.Keeper
	TransferKeeper      ibctransferkeeper.Keeper
	FeeGrantKeeper      feegrantkeeper.Keeper
	AuthzKeeper         authzkeeper.Keeper
	PacketForwardKeeper *packetforwardkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper

	FanTokenKeeper   fantokenkeeper.Keeper
	MerkledropKeeper merkledropkeeper.Keeper
	// contains filtered or unexported fields
}

BitsongApp extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.

func NewBitsongApp

func NewBitsongApp(
	logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
	homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig,
	appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
) *BitsongApp

NewBitsongApp returns a reference to an initialized BitsongApp.

func Setup added in v0.8.0

func Setup(isCheckTx bool) *BitsongApp

Setup initializes a new BitsongApp

func SetupWithGenesisAccounts added in v0.14.0

func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *BitsongApp

SetupWithGenesisAccounts initializes a new SimApp with the provided genesis accounts and possible balances.

func (*BitsongApp) AppCodec added in v0.11.0

func (app *BitsongApp) AppCodec() codec.Codec

AppCodec returns Gaia'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 (*BitsongApp) BeginBlocker added in v0.11.0

func (app *BitsongApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker application updates every begin block

func (*BitsongApp) EndBlocker added in v0.11.0

func (app *BitsongApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker application updates every end block

func (*BitsongApp) ExportAppStateAndValidators added in v0.11.0

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

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

func (*BitsongApp) GetKey added in v0.11.0

func (app *BitsongApp) GetKey(storeKey string) *sdk.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

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

func (*BitsongApp) GetMemKey added in v0.11.0

func (app *BitsongApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*BitsongApp) GetSubspace added in v0.11.0

func (app *BitsongApp) 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 (*BitsongApp) GetTKey added in v0.11.0

func (app *BitsongApp) GetTKey(storeKey string) *sdk.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

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

func (*BitsongApp) InitChainer added in v0.11.0

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

InitChainer application update at chain initialization

func (*BitsongApp) InterfaceRegistry added in v0.11.0

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

InterfaceRegistry returns Gaia's InterfaceRegistry

func (*BitsongApp) LegacyAmino added in v0.11.0

func (app *BitsongApp) 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 (*BitsongApp) LoadHeight added in v0.11.0

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

LoadHeight loads a particular height

func (*BitsongApp) ModuleAccountAddrs added in v0.11.0

func (app *BitsongApp) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*BitsongApp) Name added in v0.11.0

func (app *BitsongApp) Name() string

Name returns the name of the App

func (*BitsongApp) RegisterAPIRoutes added in v0.11.0

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

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

func (*BitsongApp) RegisterTendermintService added in v0.11.0

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*BitsongApp) RegisterTxService added in v0.11.0

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

RegisterTxService implements the Application.RegisterTxService method.

func (*BitsongApp) SimulationManager added in v0.11.0

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

SimulationManager implements the SimulationApp interface

type CosmosApp added in v0.8.0

type CosmosApp interface {
	// Name The assigned name of the app.
	Name() string

	// LegacyAmino The application types codec.
	// NOTE: This shoult be sealed before being returned.
	LegacyAmino() *codec.LegacyAmino

	// BeginBlocker Application updates every begin block.
	BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

	// EndBlocker Application updates every end block.
	EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

	// InitChainer Application update at chain (i.e app) initialization.
	InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

	// LoadHeight Loads the app at a given height.
	LoadHeight(height int64) error

	// ExportAppStateAndValidators Exports the state of the application for a genesis file.
	ExportAppStateAndValidators(
		forZeroHeight bool, jailAllowedAddrs []string,
	) (types.ExportedApp, error)

	// ModuleAccountAddrs All the registered module account addreses.
	ModuleAccountAddrs() map[string]bool
}

CosmosApp implements the common methods for a Cosmos SDK-based application specific blockchain.

type EmptyAppOptions added in v0.14.0

type EmptyAppOptions struct{}

EmptyAppOptions is a stub implementing AppOptions

func (EmptyAppOptions) Get added in v0.14.0

func (ao EmptyAppOptions) Get(o string) interface{}

Get implements AppOptions

type GenesisState added in v0.5.0

type GenesisState map[string]json.RawMessage

The genesis state 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 NewDefaultGenesisState added in v0.5.0

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for the application.

func NewDefaultGenesisStateWithCodec added in v0.14.0

func NewDefaultGenesisStateWithCodec(cdc codec.JSONCodec) GenesisState

type HandlerOptions added in v0.10.0

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper         *ibckeeper.Keeper
	TxCounterStoreKey sdk.StoreKey
	WasmConfig        wasmTypes.WasmConfig
	Cdc               codec.BinaryCodec
}

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

type MinValCommissionDecorator added in v0.10.0

type MinValCommissionDecorator struct {
	// contains filtered or unexported fields
}

func NewMinValCommissionDecorator added in v0.10.0

func NewMinValCommissionDecorator(cdc codec.BinaryCodec) MinValCommissionDecorator

func (MinValCommissionDecorator) AnteHandle added in v0.10.0

func (min MinValCommissionDecorator) AnteHandle(
	ctx sdk.Context, tx sdk.Tx,
	simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

Directories

Path Synopsis
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.
upgrades

Jump to

Keyboard shortcuts

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