app

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 167 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Name defines the application binary name
	Name           = "haqqd"
	MainnetChainID = "haqq_11235"
)
View Source
const PremintAmount = 20_000_000_000

Variables

View Source
var (
	MinGasPrices     = sdk.NewDec(20_000_000_000)
	MinGasMultiplier = sdk.NewDecWithPrec(5, 1)
)
View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.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 Evmos testing.

View Source
var ErrCommunitySpendingComingLater = sdkerrors.Register("haqq-ante", 6001, "community fund spend coming later")
View Source
var EthDefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

EthDefaultConsensusParams defines the default Tendermint consensus params used in HaqqApp testing.

Functions

func GenesisStateWithValSet added in v1.3.0

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

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func NewDefaultGenesisState

func NewDefaultGenesisState() types.GenesisState

NewDefaultGenesisState generates the default state for the application.

func NewHaqqAnteHandlerDecorator

func NewHaqqAnteHandlerDecorator(_ keeper.Keeper, h types.AnteHandler) types.AnteHandler

func NewTestGenesisState added in v1.6.0

func NewTestGenesisState(codec codec.Codec) types.GenesisState

NewTestGenesisState generate genesis state with single validator

func ObservabilityViews

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

func RegisterSwaggerAPI

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

RegisterSwaggerAPI registers swagger route with API Server

func SetupTestingApp

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

SetupTestingApp initializes the IBC-go testing application

Types

type Haqq

type Haqq struct {
	*baseapp.BaseApp

	// keepers
	AccountKeeper         authkeeper.AccountKeeper
	BankKeeper            bankkeeper.Keeper
	CapabilityKeeper      *capabilitykeeper.Keeper
	StakingKeeper         stakingkeeper.Keeper
	SlashingKeeper        slashingkeeper.Keeper
	DistrKeeper           distrkeeper.Keeper
	GovKeeper             govkeeper.Keeper
	CrisisKeeper          crisiskeeper.Keeper
	UpgradeKeeper         upgradekeeper.Keeper
	ParamsKeeper          paramskeeper.Keeper
	FeeGrantKeeper        feegrantkeeper.Keeper
	AuthzKeeper           authzkeeper.Keeper
	IBCKeeper             *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
	ICAHostKeeper         icahostkeeper.Keeper
	EvidenceKeeper        evidencekeeper.Keeper
	TransferKeeper        transferkeeper.Keeper
	ConsensusParamsKeeper consensusparamkeeper.Keeper

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

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

	// Evmos keepers
	Erc20Keeper         erc20keeper.Keeper
	EpochsKeeper        epochskeeper.Keeper
	VestingKeeper       vestingkeeper.Keeper
	LiquidVestingKeeper liquidvestingkeeper.Keeper

	// Haqq keepers
	CoinomicsKeeper coinomicskeeper.Keeper
	// contains filtered or unexported fields
}

Haqq implements an extended ABCI application. It is an application that may process transactions through Ethereum's EVM running atop of CometBFT consensus.

func EthSetup added in v1.6.0

func EthSetup(isCheckTx bool, patchGenesis func(*Haqq, types.GenesisState) types.GenesisState) *Haqq

EthSetup initializes a new HaqqApp. A Nop logger is set in HaqqApp.

func EthSetupWithDB added in v1.6.0

func EthSetupWithDB(isCheckTx bool, patchGenesis func(*Haqq, types.GenesisState) types.GenesisState, db dbm.DB) *Haqq

EthSetupWithDB initializes a new HaqqApp. A Nop logger is set in HaqqApp.

func NewHaqq

func NewHaqq(
	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),
) *Haqq

NewHaqq returns a reference to a new initialized Ethermint application.

func Setup

func Setup(
	isCheckTx bool,
	feemarketGenesis *feemarkettypes.GenesisState,
) (*Haqq, []byte)

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

func (*Haqq) AppCodec

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

AppCodec returns Haqq'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 (*Haqq) BeginBlocker

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

BeginBlocker runs the CometBFT 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 (*Haqq) BlockedAddrs

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

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

func (*Haqq) DeliverTx

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

We are intentionally decomposing the DeliverTx method so as to calculate the transactions per second.

func (*Haqq) EndBlocker

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

EndBlocker updates every end block

func (*Haqq) ExportAppStateAndValidators

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

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

func (*Haqq) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Haqq) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Haqq) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Haqq) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Haqq) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*Haqq) GetStakingKeeperSDK added in v1.6.0

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

GetStakingKeeperSDK implements the TestingApp interface.

func (*Haqq) GetSubspace

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

func (app *Haqq) 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 (*Haqq) GetTxConfig

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

GetTxConfig implements the TestingApp interface.

func (*Haqq) InitChainer

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

InitChainer updates at chain initialization

func (*Haqq) InterfaceRegistry

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

InterfaceRegistry returns Haqq's InterfaceRegistry

func (*Haqq) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Haqq) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Haqq) Name

func (app *Haqq) Name() string

Name returns the name of the App

func (*Haqq) RegisterAPIRoutes

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

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

func (*Haqq) RegisterNodeService added in v1.6.0

func (app *Haqq) RegisterNodeService(clientCtx client.Context)

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

func (*Haqq) RegisterTendermintService

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

func (*Haqq) RegisterTxService

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

func (*Haqq) ScheduleForkUpgrade added in v1.1.9

func (app *Haqq) ScheduleForkUpgrade(ctx sdk.Context)

ScheduleForkUpgrade executes any necessary fork logic for based upon the current block height and chain ID (mainnet or testnet). It sets an upgrade plan once the chain reaches the pre-defined upgrade height.

CONTRACT: for this logic to work properly it is required to:

  1. Release a non-breaking patch version so that the chain can set the scheduled upgrade plan at upgrade-height.
  2. Release the software defined in the upgrade-info

func (*Haqq) SimulationManager

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

SimulationManager implements the SimulationApp interface

Directories

Path Synopsis
evm
upgrades

Jump to

Keyboard shortcuts

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