app

package
v0.0.0-...-1d4aedf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 151 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountAddressPrefix = "mer"
)
View Source
const (
	Name = "merlion"
)

Variables

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{},
		customstaking.AppModuleBasic{},
		distr.AppModuleBasic{},
		gov.NewAppModuleBasic(getGovProposalHandlers()...),
		params.AppModuleBasic{},
		crisis.AppModuleBasic{},
		slashing.AppModuleBasic{},
		feegrantmodule.AppModuleBasic{},
		ibc.AppModuleBasic{},
		upgrade.AppModuleBasic{},
		evidence.AppModuleBasic{},
		transfer.AppModuleBasic{},
		evm.AppModuleBasic{},
		feemarket.AppModuleBasic{},
		erc20.AppModuleBasic{},
		oracle.AppModuleBasic{},
		maker.AppModuleBasic{},
		nft.AppModuleBasic{},
		ve.AppModuleBasic{},
		gauge.AppModuleBasic{},
		voter.AppModuleBasic{},
		customvesting.AppModuleBasic{},
		mgravity.AppModuleBasic{},
		bech32ibc.AppModuleBasic{},
	)
)

Functions

func AddTestAddrs

func AddTestAddrs(app *Merlion, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress

AddTestAddrs constructs and returns accNum amount of accounts with an initial balance of accAmt in random order

func ConsumeMultisignatureVerificationGas

func ConsumeMultisignatureVerificationGas(
	meter sdk.GasMeter, sig *signing.MultiSignatureData, pubkey multisig.PubKey,
	params authtypes.Params, accSeq uint64,
) error

ConsumeMultisignatureVerificationGas consumes gas from a GasMeter for verifying a multisig pubkey signature

func FundAccount

func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error

FundAccount is a utility function that funds an account by minting and sending the coins to the address. This should be used for testing purposes only!

func FundModuleAccount

func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, amounts sdk.Coins) error

FundModuleAccount is a utility function that funds a module account by minting and sending the coins to the address. This should be used for testing purposes only!

func FundTestAddrs

func FundTestAddrs(app *Merlion, ctx sdk.Context, addrs []sdk.AccAddress, accAmt sdk.Int)

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func ObservabilityViews

func ObservabilityViews() (views []*view.View)

func RegisterDenoms

func RegisterDenoms()

RegisterDenoms registers the base and display denominations to the SDK.

func SetBech32Prefixes

func SetBech32Prefixes(config *sdk.Config, accountAddressPrefix string)

SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.

func SetBip44CoinType

func SetBip44CoinType(config *sdk.Config)

SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.

func SetupConfig

func SetupConfig()

func SigVerificationGasConsumer

func SigVerificationGasConsumer(
	meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params,
) error

SigVerificationGasConsumer is the Evmos implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type. The types of keys supported are:

- ethsecp256k1 (Ethereum keys)

- ed25519 (Validators)

- multisig (Cosmos SDK multisigs)

Types

type App

type App interface {
	servertypes.Application
	ExportableApp
}

App represents a Cosmos SDK application that can be run as a server and with an exportable state

func NewMerlion

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

NewMerlion returns a reference to an initialized blockchain app

type ExportableApp

type ExportableApp interface {
	ExportAppStateAndValidators(
		forZeroHeight bool,
		jailAllowedAddrs []string,
	) (servertypes.ExportedApp, error)
	LoadHeight(height int64) error
}

ExportableApp represents an app with an exportable state

type GenerateAccountStrategy

type GenerateAccountStrategy func(int) []sdk.AccAddress

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

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for the application.

type Merlion

type Merlion struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    customstakingkeeper.Keeper
	SlashingKeeper   slashingkeeper.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
	EvidenceKeeper   evidencekeeper.Keeper
	TransferKeeper   ibctransferkeeper.Keeper
	FeeGrantKeeper   feegrantkeeper.Keeper

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

	// Ethermint keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper

	Erc20Keeper erc20keeper.Keeper

	OracleKeeper oraclekeeper.Keeper
	MakerKeeper  makerkeeper.Keeper

	NftKeeper   vekeeper.NftKeeper
	VeKeeper    vekeeper.Keeper
	GaugeKeeper gaugekeeper.Keeper
	VoterKeeper voterkeeper.Keeper

	VestingKeeper customvestingkeeper.Keeper

	GravityKeeper   mgravitykeeper.Keeper
	Bech32IbcKeeper bech32ibckeeper.Keeper
	// contains filtered or unexported fields
}

Merlion 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 Setup

func Setup(isCheckTx bool) *Merlion

Setup initializes a new Merlion

func (*Merlion) AppCodec

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

AppCodec returns an 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 (*Merlion) BeginBlocker

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

BeginBlocker application updates every begin block

func (*Merlion) BlockedAddrs

func (app *Merlion) BlockedAddrs() map[string]bool

BlockedAddrs returns all the app's module account addresses that are not allowed to receive tokens.

func (*Merlion) DeliverTx

func (app *Merlion) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)

func (*Merlion) EndBlocker

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

EndBlocker application updates every end block

func (*Merlion) ExportAppStateAndValidators

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

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

func (Merlion) GetBaseApp

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

GetBaseApp returns the base app of the application

func (*Merlion) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Merlion) GetSubspace

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

func (app *Merlion) 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 (*Merlion) InitChainer

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

InitChainer application update at chain initialization

func (*Merlion) InterfaceRegistry

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

InterfaceRegistry returns an InterfaceRegistry

func (*Merlion) LegacyAmino

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

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

LoadHeight loads a particular height

func (*Merlion) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Merlion) Name

func (app *Merlion) Name() string

Name returns the name of the Merlion

func (*Merlion) RegisterAPIRoutes

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

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

func (*Merlion) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*Merlion) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

func (*Merlion) SimulationManager

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

SimulationManager implements the SimulationApp interface

Jump to

Keyboard shortcuts

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