simapp

package module
v0.0.0-...-21d45e2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 90 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 ProvideAttributeKeeperStub

func ProvideAttributeKeeperStub() *attributekeeper.Keeper

ProvideAttributeKeeperStub returns an empty attributekeeper.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 AttributeKeeper 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.

func ProvideExchangeCustomSigners

func ProvideExchangeCustomSigners() []signing.CustomGetSigner

ProvideExchangeCustomSigners returns the CustomGetSigner functions for the exchange module message types whose signer is nested inside a Payment field rather than being a top-level address field. MsgCreatePaymentRequest is signed by the payment source and MsgAcceptPaymentRequest is signed by the payment target. Registering these is required both to pass signing context validation during app initialization and to allow the SimApp to process real exchange payment transactions.

func ProvideExchangeKeeperStub

func ProvideExchangeKeeperStub() vaulttypes.ExchangeKeeper

ProvideExchangeKeeperStub returns an empty types.ExchangeKeeper 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 ExchangeKeeper is initialized separately using the legacy Provenance wiring in SimApp.

It returns the vaultExchangeKeeper adapter so the stub satisfies the full types.ExchangeKeeper interface, including the GetPaymentsWithTarget lookup that the raw exchange keeper exposes only through its query server.

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.

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.

func ProvideNameKeeperStub

func ProvideNameKeeperStub() *namekeeper.Keeper

ProvideNameKeeperStub returns an empty namekeeper.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 NameKeeper 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.BaseKeeper
	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

	// Provenance Modules
	NameKeeper      namekeeper.Keeper
	AttributeKeeper attributekeeper.Keeper
	MarkerKeeper    markerkeeper.Keeper
	MetadataKeeper  metadatakeeper.Keeper
	HoldKeeper      holdkeeper.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) 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 name, attribute, and marker modules.
  • Initializes the NameKeeper, AttributeKeeper, and MarkerKeeper using the legacy Provenance wiring pattern.
  • Injects the MarkerKeeper, NameKeeper, and AttributeKeeper into the VaultKeeper (via app.VaultKeeper.MarkerKeeper, app.VaultKeeper.NameKeeper, and app.VaultKeeper.AttrKeeper) to enable restricted marker management, name resolution, and attribute-based gating within the vault module.
  • 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

func (*SimApp) TxConfig

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

TxConfig returns the SimApp's TxConfig, used by tests to build and sign transactions.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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