app

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: LGPL-3.0 Imports: 136 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "settlus"
)

Variables

View Source
var DefaultConsensusParams = &abci.ConsensusParams{
	Block: &abci.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in Settlus testing.

View Source
var DefaultTestingAppInit func() (ibctesting.TestingApp, map[string]json.RawMessage) = SetupTestingApp

DefaultTestingAppInit defines the IBC application used for testing

Functions

func GenesisStateWithValSet

func GenesisStateWithValSet(app *App, genesisState simapp.GenesisState,
	valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount,
	balances ...banktypes.Balance,
) simapp.GenesisState

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeEncodingConfig

func MakeEncodingConfig() appparams.EncodingConfig

MakeEncodingConfig creates an EncodingConfig for testing

func NewDefaultGenesisState

func NewDefaultGenesisState() simapp.GenesisState

NewDefaultGenesisState generates the default state for the application.

func ObservabilityViews

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

func SetupTestingApp

func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

Types

type App

type App struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper    authkeeper.AccountKeeper
	AuthzKeeper      authzkeeper.Keeper
	BankKeeper       bankkeeper.Keeper
	CapabilityKeeper *capabilitykeeper.Keeper
	StakingKeeper    stakingkeeper.Keeper
	SlashingKeeper   slashingkeeper.Keeper
	MintKeeper       mintkeeper.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   transferkeeper.Keeper
	ICAHostKeeper    icahostkeeper.Keeper
	FeeGrantKeeper   feegrantkeeper.Keeper
	GroupKeeper      groupkeeper.Keeper

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

	// this line is used by starport scaffolding # stargate/app/keeperDeclaration
	// Evmos keepers
	EvmKeeper       *evmkeeper.Keeper
	FeeMarketKeeper feemarketkeeper.Keeper
	Erc20Keeper     erc20keeper.Keeper

	// Settlus keepers
	SettlementKeeper *settlementmodulekeeper.SettlementKeeper
	OracleKeeper     *oraclemodulekeeper.Keeper
	// contains filtered or unexported fields
}

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

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

New returns a reference to an initialized blockchain app

func Setup

func Setup(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
) *App

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

func (*App) AppCodec

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

AppCodec returns Evmos's 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) BeginBlocker

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

BeginBlocker runs the Tendermint ABCI BeginBlock logic. It executes state changes at the beginning of the new block for every registered module. If there is a registered fork at the current height, BeginBlocker will schedule the upgrade plan and perform the state migration (if any).

func (*App) BlockedAddrs

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

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

func (*App) DeliverTx

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

The DeliverTx method is intentionally decomposed to calculate the transactions per second.

func (*App) EndBlocker

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

EndBlocker updates every end block

func (*App) ExportAppStateAndValidators

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

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

func (*App) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*App) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

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

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*App) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*App) GetStakingKeeperSDK

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

GetStakingKeeperSDK implements the TestingApp interface.

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

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

GetTxConfig implements the TestingApp interface.

func (*App) InitChainer

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

InitChainer updates at chain initialization

func (*App) InterfaceRegistry

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

InterfaceRegistry returns Evmos's InterfaceRegistry

func (*App) LegacyAmino

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

LegacyAmino returns Evmos'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 (*App) LoadHeight

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

LoadHeight loads state at a particular height

func (*App) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*App) Name

func (app *App) Name() string

Name returns the name of the App

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)

RegisterNodeService registers the node gRPC service on the provided application gRPC query router.

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)

func (*App) SimulationManager

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

SimulationManager implements the SimulationApp interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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