app

package
v2.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: GPL-3.0 Imports: 117 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountAddressPrefix = "mars"
	Name                 = "mars"

	// BondDenom is the staking token's denomination
	BondDenom = "umars"

	// 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 = ""
)

Variables

View Source
var (
	// DefaultNodeHome the default home directory for the app daemon
	DefaultNodeHome string

	// ModuleBasics defines the module `BasicManager`, which is in charge of
	// setting up basic, non- dependent module elements, such as codec
	// registration and genesis verification
	ModuleBasics = module.NewBasicManager(
		auth.AppModuleBasic{},
		authzmodule.AppModuleBasic{},
		bank.AppModuleBasic{},
		capability.AppModuleBasic{},
		crisis.AppModuleBasic{},
		distr.AppModuleBasic{},
		evidence.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		genutil.AppModuleBasic{},
		gov.NewAppModuleBasic(govProposalHandlers),
		params.AppModuleBasic{},
		slashing.AppModuleBasic{},
		staking.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		ibc.AppModuleBasic{},
		ibctransfer.AppModuleBasic{},
		ica.AppModuleBasic{},
		wasm.AppModuleBasic{},
		incentives.AppModuleBasic{},
		safety.AppModuleBasic{},
		envoy.AppModuleBasic{},
	)

	// scheduled upgrades and forks
	Upgrades = []upgrades.Upgrade{v2.Upgrade}
	Forks    = []upgrades.Fork{}
)

Functions

func NewAnteHandler

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

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

Types

type EncodingConfig

type EncodingConfig struct {
	InterfaceRegistry codectypes.InterfaceRegistry
	Codec             codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.

func MakeEncodingConfig

func MakeEncodingConfig() EncodingConfig

MakeEncodingConfig creates an EncodingConfig instance; registers types with codec and interface registry.

func NewEncodingConfig

func NewEncodingConfig() EncodingConfig

MakeEncodingConfig creates an EncodingConfig instance

type GenesisState

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 an 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 retieved from the `ModuleBasicManager` which populates JSON from each `BasicModule` object provided to it during init.

func DefaultGenesisState

func DefaultGenesisState(cdc codec.JSONCodec) GenesisState

DefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCKeeper         *ibckeeper.Keeper
	WasmConfig        wasmtypes.WasmConfig
	TxCounterStoreKey storetypes.StoreKey
}

HandlerOptions extends the SDK's `AnteHandler` options by requiring additional keepers.

type MarsApp

type MarsApp struct {
	// baseapp
	*baseapp.BaseApp

	Codec codec.Codec // make codec public for testing purposes

	// keepers
	AccountKeeper       authkeeper.AccountKeeper
	AuthzKeeper         authzkeeper.Keeper
	BankKeeper          bankkeeper.Keeper
	CapabilityKeeper    *capabilitykeeper.Keeper
	CrisisKeeper        crisiskeeper.Keeper
	DistrKeeper         distrkeeper.Keeper
	EvidenceKeeper      evidencekeeper.Keeper
	FeeGrantKeeper      feegrantkeeper.Keeper
	GovKeeper           customgovkeeper.Keeper // replaces the vanilla gov keeper with our custom one
	ParamsKeeper        paramskeeper.Keeper
	SlashingKeeper      slashingkeeper.Keeper
	StakingKeeper       stakingkeeper.Keeper
	UpgradeKeeper       upgradekeeper.Keeper
	IBCKeeper           *ibckeeper.Keeper // must be a pointer, so we can `SetRouter` on it correctly
	IBCTransferKeeper   ibctransferkeeper.Keeper
	ICAControllerKeeper icacontrollerkeeper.Keeper
	ICAHostKeeper       icahostkeeper.Keeper
	WasmKeeper          wasm.Keeper
	IncentivesKeeper    incentiveskeeper.Keeper
	SafetyKeeper        safetykeeper.Keeper
	EnvoyKeeper         envoykeeper.Keeper

	// make scoped keepers public for testing purposes
	ScopedIBCKeeper           capabilitykeeper.ScopedKeeper
	ScopedIBCTransferKeeper   capabilitykeeper.ScopedKeeper
	ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
	ScopedICAHostKeeper       capabilitykeeper.ScopedKeeper
	ScopedWasmKeeper          capabilitykeeper.ScopedKeeper
	// contains filtered or unexported fields
}

MarsApp 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 NewMarsApp

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

NewMarsApp creates and initializes a new `MarsApp` instance

func (*MarsApp) AppCodec

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

func (*MarsApp) BeginBlocker

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

BeginBlocker application updates every begin block

func (*MarsApp) EndBlocker

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

EndBlocker application updates on every end block

func (*MarsApp) ExportAppStateAndValidators

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

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

func (*MarsApp) GetBaseApp

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

func (*MarsApp) GetIBCKeeper

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

func (*MarsApp) GetScopedIBCKeeper

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

func (*MarsApp) GetStakingKeeper

func (app *MarsApp) GetStakingKeeper() ibctestingtypes.StakingKeeper

func (*MarsApp) GetTxConfig

func (app *MarsApp) GetTxConfig() client.TxConfig

func (*MarsApp) InitChainer

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

InitChainer application updates at chain initialization

func (*MarsApp) LegacyAmino

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

LegacyAmino returns the app's legacy amino codec

func (*MarsApp) LoadHeight

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

LoadHeight loads a particular height

func (*MarsApp) ModuleAccountAddrs

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

ModuleAccountAddrs return the app's module account addresses

func (*MarsApp) Name

func (app *MarsApp) Name() string

Name returns the app's name

func (*MarsApp) RegisterAPIRoutes

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

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

func (*MarsApp) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*MarsApp) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*MarsApp) SimulationManager

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

NOTE: we don't actually use simulation manager anywhere in this project, so we simply return nil.

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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