simapp

package module
v0.0.0-...-6a15c77 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 89 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppConfigYAML []byte
View Source
var DefaultConsensusParams = &cmttmtypes.ConsensusParams{
	Block: &cmttmtypes.BlockParams{
		MaxBytes: 200000,
		MaxGas:   60_000_000,
	},
	Evidence: &cmttmtypes.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &cmttmtypes.ValidatorParams{
		PubKeyTypes: []string{
			cmttypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default consensus params used in SimApp testing.

View Source
var DefaultNodeHome string

Functions

func AppConfig

func AppConfig() depinject.Config

AppConfig returns the default app config.

func NewAppOptionsWithFlagHome

func NewAppOptionsWithFlagHome(homePath string) servertypes.AppOptions

func ProvideExchangeDummyCustomSigners

func ProvideExchangeDummyCustomSigners() []signing.CustomGetSigner

ProvideExchangeDummyCustomSigners returns a slice of dummy CustomGetSigner functions for the exchange module. These are used to register placeholder signer functions for specific message types (e.g., MsgAcceptPaymentRequest, MsgCreatePaymentRequest) to satisfy the signing context validation during app initialization.

func ProvideMarkerKeeperStub

func ProvideMarkerKeeperStub() *markerkeeper.Keeper

ProvideMarkerKeeperStub returns an empty markerkeeper.Keeper instance.

This stub is used to satisfy dependency injection requirements when wiring the Vault module in the app module configuration. It allows the Vault module to be included in the dependency graph even though the actual MarkerKeeper is initialized separately using the legacy Provenance wiring in SimApp.

This function should only be used during app setup and should not be relied on at runtime, as the returned keeper is not fully configured and will panic if used.

Types

type AppOptionsMap

type AppOptionsMap map[string]interface{}

func (AppOptionsMap) Get

func (m AppOptionsMap) Get(key string) interface{}

type GenesisState

type GenesisState map[string]json.RawMessage

type GroupCheckerFunc

type GroupCheckerFunc func(sdk.Context, sdk.AccAddress) bool

GroupCheckerFunc convenient type to match the GroupChecker interface.

func NewGroupCheckerFunc

func NewGroupCheckerFunc(querier GroupPolicyQuerier) GroupCheckerFunc

NewGroupCheckerFunc creates a new GroupChecker function for checking if an account is in a group.

func (GroupCheckerFunc) IsGroupAddress

func (t GroupCheckerFunc) IsGroupAddress(ctx sdk.Context, account sdk.AccAddress) bool

IsGroupAddress checks if the account is a group address.

type GroupPolicyQuerier

type GroupPolicyQuerier interface {
	GroupPolicyInfo(goCtx context.Context, request *group.QueryGroupPolicyInfoRequest) (*group.QueryGroupPolicyInfoResponse, error)
}

GroupPolicyQuerier provides functionality to query group policies.

type SimApp

type SimApp struct {
	*runtime.App

	// Cosmos Modules
	AccountKeeper   authkeeper.AccountKeeper
	BankKeeper      bankkeeper.Keeper
	ConsensusKeeper consensuskeeper.Keeper
	CrisisKeeper    *crisiskeeper.Keeper
	ParamsKeeper    paramskeeper.Keeper
	StakingKeeper   *stakingkeeper.Keeper
	UpgradeKeeper   *upgradekeeper.Keeper

	AuthzKeeper    authzkeeper.Keeper
	FeegrantKeeper feegrantkeeper.Keeper
	GroupKeeper    groupkeeper.Keeper
	// TODO We want to set this up
	GovKeeper          *govkeeper.Keeper
	DistributionKeeper *distributionkeeper.Keeper

	// IBC Modules
	CapabilityKeeper *capabilitykeeper.Keeper
	IBCKeeper        *ibckeeper.Keeper
	// Provenance Modules
	NameKeeper      namekeeper.Keeper
	AttributeKeeper attributekeeper.Keeper
	MarkerKeeper    markerkeeper.Keeper
	// ExchangeKeeper  exchangekeeper.Keeper
	// Custom Modules
	VaultKeeper *vaultkeeper.Keeper
	// contains filtered or unexported fields
}

SimApp 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 NewSimApp

func NewSimApp(
	logger log.Logger,
	db dbm.DB,
	traceStore io.Writer,
	loadLatest bool,
	appOpts servertypes.AppOptions,
	baseAppOptions ...func(*baseapp.BaseApp),
) (*SimApp, error)

NewSimApp returns a reference to an initialized SimApp.

func Setup

func Setup(t *testing.T) *SimApp

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

func SetupWithGenesisValSet

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

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

func (*SimApp) AppCodec

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

func (*SimApp) ExportAppStateAndValidators

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

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

func (*SimApp) GetKey

func (app *SimApp) GetKey(storeKey string) *storetypes.KVStoreKey

func (*SimApp) GetMemKey

func (app *SimApp) GetMemKey(memKey string) *storetypes.MemoryStoreKey

func (*SimApp) GetSubspace

func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace

func (*SimApp) LegacyAmino

func (app *SimApp) LegacyAmino() *codec.LegacyAmino

func (*SimApp) RegisterLegacyModules

func (app *SimApp) RegisterLegacyModules() error

func (*SimApp) RegisterProvenanceModules

func (app *SimApp) RegisterProvenanceModules() error

RegisterProvenanceModules sets up and registers the Provenance modules used by the SimApp, including name, attribute, marker, and vault modules.

It performs the following actions:

  • Registers the KV store keys required by the modules.
  • Initializes the NameKeeper, AttributeKeeper, and MarkerKeeper using the legacy Provenance wiring pattern.
  • Injects the MarkerKeeper into the VaultKeeper to fulfill its dependency.
  • Registers the modules with the app for inclusion in BeginBlocker, EndBlocker, InitGenesis, etc.

This function is typically called during app initialization to ensure all Provenance modules are correctly configured and available.

Returns an error if store registration fails.

func (*SimApp) SimulationManager

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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