app

package
v6.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MPL-2.0 Imports: 205 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContractMemoryLimit is the memory limit of each contract execution (in MiB)
	// constant value so all nodes run with the same limit.
	ContractMemoryLimit = uint32(32)
)
View Source
const WTokenContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517"

WTokenContractMainnet is the WrappedToken contract address for mainnet

Variables

View Source
var (
	NodeDir = ".mantrachain"
	// DefaultNodeHome default home directories for the application daemon
	DefaultNodeHome string
)

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

View Source
var (
	EVMChainIDMap = map[string]uint64{
		"mantra-1":            5888,
		"mantra-dukong-1":     5887,
		"mantra-canary-net-1": 7888,
	}

	MANTRAChainID uint64 = 262144 // default Chain ID
)
View Source
var EVMCoinInfo = evmtypes.EvmCoinInfo{
	Denom:         "uom",
	ExtendedDenom: "aom",
	DisplayDenom:  "om",
	Decimals:      evmtypes.SixDecimals.Uint32(),
}
View Source
var ExampleTokenPairs = []erc20types.TokenPair{
	{
		Erc20Address:  WTokenContractMainnet,
		Denom:         "uom",
		Enabled:       true,
		ContractOwner: erc20types.OWNER_MODULE,
	},
}

ExampleTokenPairs creates a slice of token pairs, that contains a pair for the native denom of the example chain implementation.

View Source
var FeeDenom = "uom"
View Source
var Upgrades = []upgrades.Upgrade{
	v61.Upgrade,
}

Functions

func AddTestAddrsIncremental

func AddTestAddrsIncremental(app *App, 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

func AllCapabilities() []string

AllCapabilities returns all capabilities available with the current wasmvm See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md This functionality is going to be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425

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 IsModuleWhiteList

func IsModuleWhiteList(typeUrl string) bool

This is used for non-legacy gov transactions Returning true cause all txs are whitelisted

func IsProposalWhitelisted

func IsProposalWhitelisted(content govv1beta1.Content) bool

This is used for legacy gov transactions Returning true cause all txs are whitelisted

func MakeEncodingConfig

func MakeEncodingConfig(tb testing.TB) params.EncodingConfig

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

func NewAppOptionsWithFlagHome

func NewAppOptionsWithFlagHome(homePath string) servertypes.AppOptions

func NewEVMAnteHandlerOptionsFromApp

func NewEVMAnteHandlerOptionsFromApp(app *App, txConfig client.TxConfig, maxGasWanted uint64) *ante.EVMHandlerOptions

func NewTestNetworkFixture

func NewTestNetworkFixture() network.TestFixture

NewTestNetworkFixture returns a new App AppConstructor for network simulation tests

func ParseChainID

func ParseChainID(chainID string) (uint64, error)

ParseChainID parses a string chain identifier's epoch to an Ethereum-compatible chain-id in *big.Int format. The function returns an error if the chain-id has an invalid format

func RegisterSwaggerAPI

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

RegisterSwaggerAPI registers swagger route with API Server.

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 App

type App struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.BaseKeeper
	StakingKeeper         stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	MintKeeper            mintkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	CrisisKeeper          *crisiskeeper.Keeper //nolint:staticcheck
	UpgradeKeeper         *upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper //nolint:staticcheck
	AuthzKeeper           authzkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	NFTKeeper             nftkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper
	CircuitKeeper         circuitkeeper.Keeper

	// Connect
	OracleKeeper    *oraclekeeper.Keeper
	MarketMapKeeper *marketmapkeeper.Keeper

	// IBC
	IBCKeeper           *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	ICAHostKeeper       icahostkeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	TransferKeeper      transferkeeper.Keeper
	WasmKeeper          wasmkeeper.Keeper
	RateLimitKeeper     ratelimitkeeper.Keeper
	CallbackKeeper      ibccallbackskeeper.ContractKeeper

	// MANTRAChain keepers
	TokenFactoryKeeper tokenfactorykeeper.Keeper
	TaxKeeper          taxkeeper.Keeper
	SanctionKeeper     sanctionkeeper.Keeper

	// Cosmos EVM keepers
	FeeMarketKeeper   feemarketkeeper.Keeper
	EVMKeeper         *evmkeeper.Keeper
	Erc20Keeper       erc20keeper.Keeper
	PreciseBankKeeper precisebankkeeper.Keeper
	EVMMempool        *evmmempool.ExperimentalEVMMempool

	// the module manager
	ModuleManager      *module.Manager
	BasicModuleManager module.BasicManager
	// contains filtered or unexported fields
}

App extended ABCI application

func MakeTestApp

func MakeTestApp(tb testing.TB) *App

func New

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

New returns a reference to an initialized App.

func NewWasmAppWithCustomOptions

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

NewWasmAppWithCustomOptions initializes a new App with custom options.

func Setup

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

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

func SetupWithEmptyStore

func SetupWithEmptyStore(tb testing.TB) *App

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,
) *App

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 (*App) AppCodec

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

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

AutoCliOpts returns the autocli options for the app.

func (*App) BeginBlocker

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

BeginBlocker application updates every begin block

func (*App) Close

func (app *App) Close() error

func (*App) Configurator

func (app *App) Configurator() module.Configurator

func (*App) DefaultGenesis

func (app *App) DefaultGenesis() map[string]json.RawMessage

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

func (*App) EndBlocker

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

EndBlocker application updates every end block

func (*App) ExportAppStateAndValidators

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

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

func (*App) GetAccountKeeper

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

func (*App) GetBankKeeper

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

func (*App) GetBaseApp

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

func (*App) GetIBCKeeper

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

func (*App) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*App) GetMempool

func (app *App) GetMempool() sdkmempool.ExtMempool

func (*App) GetStakingKeeper

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

func (*App) GetStoreKeys

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

GetStoreKeys returns all the stored store keys.

func (*App) GetSubspace

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

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

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

func (*App) InitChainer

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

InitChainer application update at chain initialization

func (*App) InterfaceRegistry

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

InterfaceRegistry returns App's InterfaceRegistry

func (*App) LegacyAmino

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

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

LoadHeight loads a particular height

func (*App) Name

func (app *App) Name() string

Name returns the name of the App

func (*App) PreBlocker

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

PreBlocker application updates every pre block

func (*App) RegisterAPIRoutes

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

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

func (*App) RegisterNodeService

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

func (*App) RegisterPendingTxListener

func (app *App) RegisterPendingTxListener(listener func(ethcommon.Hash))

RegisterPendingTxListener is used by json-rpc server to listen to pending transactions callback.

func (*App) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*App) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*App) SetClientCtx

func (app *App) SetClientCtx(clientCtx client.Context)

func (*App) SimulationManager

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

SimulationManager implements the SimulationApp interface

func (*App) TxConfig

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

TxConfig returns App's TxConfig

type AppOptionsMap

type AppOptionsMap map[string]interface{}

AppOptionsMap is a stub implementing AppOptions which can get data from a map

func (AppOptionsMap) Get

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

type EmptyAppOptions

type EmptyAppOptions struct{}

EmptyAppOptions is a stub implementing AppOptions

func (EmptyAppOptions) Get

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

Get implements AppOptions

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

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

func NewDefaultGenesisState

func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState

NewDefaultGenesisState generates the default state for the application.

type SetupOptions

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

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

Directories

Path Synopsis
Package params defines the simulation parameters in the mantra.
Package params defines the simulation parameters in the mantra.
v6
v61

Jump to

Keyboard shortcuts

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