althea

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 141 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "althea"

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 EthermintApp testing. nolint: exhaustruct

Functions

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeEncodingConfig

func MakeEncodingConfig() params.EncodingConfig

MakeEncodingConfig creates a ready-to-use EncodingConfig, loaded with all the interfaces needed during chain operation Note that this function registers both the legacy Amino format (for Ledger use) and also the new and recommended Protobuf format

func MigrateGenesisCmd

func MigrateGenesisCmd() *cobra.Command

MigrateGenesisCmd returns a command to execute genesis state migration.

func RegisterSwaggerAPI

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

RegisterSwaggerAPI registers swagger route with API Server TODO: build the custom swagger files and add here?

func SigVerificationGasConsumer

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

SigVerificationGasConsumer is the Althea-Chain implementation of SignatureVerificationGasConsumer, based on Canto's version at https://github.com/Canto-Network/Canto in the app/sigverify.go file. 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:

- secp256k1 (Cosmos keys)

HANDLED BY CANTO'S IMPLEMENTATION:

- ethsecp256k1 (Ethereum keys) - ed25519 (Validators) - multisig (Cosmos SDK multisigs)

Types

type AltheaApp

type AltheaApp struct {
	*baseapp.BaseApp

	// keepers
	// NOTE: If you add anything to this struct, add a nil check to ValidateMembers below!
	AccountKeeper     *authkeeper.AccountKeeper
	AuthzKeeper       *authzkeeper.Keeper
	BankKeeper        *bankkeeper.BaseKeeper
	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
	EvidenceKeeper    *evidencekeeper.Keeper
	IbcTransferKeeper *ibctransferkeeper.Keeper
	EvmKeeper         *evmkeeper.Keeper
	Erc20Keeper       *erc20keeper.Keeper
	FeemarketKeeper   *feemarketkeeper.Keeper
	IcaHostKeeper     *icahostkeeper.Keeper

	LockupKeeper     *lockupkeeper.Keeper
	MicrotxKeeper    *microtxkeeper.Keeper
	GasfreeKeeper    *gasfreekeeper.Keeper
	OnboardingKeeper *onboardingkeeper.Keeper
	NativedexKeeper  *nativedexkeeper.Keeper

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

	// the module manager
	MM *module.Manager

	// Configurator
	Configurator *module.Configurator

	// amino and proto encoding
	EncodingConfig altheaappparams.EncodingConfig
	// contains filtered or unexported fields
}

AltheaApp extends an ABCI application

func NewAltheaApp

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

NewAltheaApp returns a reference to an initialized Althea chain To avoid implicit duplication of critical values (thanks, Go) and buggy behavior, we declare nearly every used value locally and provide references to/duplicates of those local vars to every related constructor after initialization

func Setup

func Setup(isCheckTx bool, patchGenesis func(*AltheaApp, GenesisState) GenesisState) *AltheaApp

Setup initializes a new Althea app. A Nop logger is set in AltheaApp.

func (*AltheaApp) AppCodec

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

AppCodec returns Althea Chain's 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 (*AltheaApp) BeginBlocker

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

BeginBlocker delegates the ABCI BeginBlock execution to the ModuleManager

func (*AltheaApp) BlockedAddrs

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

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

func (*AltheaApp) EndBlocker

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

EndBlocker delegates the ABCI EndBlock execution to the ModuleManager

func (*AltheaApp) ExportAppStateAndValidators

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

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

func (*AltheaApp) GetBaseApp

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

GetBaseApp returns the baseapp, used for testing

func (*AltheaApp) GetIBCKeeper

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

GetIBCKeeper returns the IBC Keeper, used for testing

func (*AltheaApp) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*AltheaApp) GetScopedIBCKeeper

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

GetScopedIBCKeeper returns the Scoped IBC Keeper, used for testing

func (*AltheaApp) GetStakingKeeper

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

GetStakingKeeper returns the staking Keeper, used for testing

func (*AltheaApp) GetSubspace

func (app *AltheaApp) GetSubspace(moduleName string) paramstypes.Subspace

GetSubspace returns a param subspace for a given module name. Reading params is fine, but they should be updated by governace proposal

func (*AltheaApp) GetTKey

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

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

GetTxConfig returns the Encoding config's tx config, used for testing

func (*AltheaApp) InitChainer

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

InitChainer deserializes the given chain genesis state, registers in-place upgrade migrations, and delegates the ABCI InitGenesis execution to the ModuleManager

func (*AltheaApp) InterfaceRegistry

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

InterfaceRegistry returns Althea Chain's InterfaceRegistry which knows all of the Protobuf-defined interfaces and implementing types the chain is aware of

func (*AltheaApp) LegacyAmino

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

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

LoadHeight loads the blockchain a particular height

func (*AltheaApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*AltheaApp) Name

func (app *AltheaApp) Name() string

Name returns the name of the App

func (*AltheaApp) NewAnteHandlerOptions

func (app *AltheaApp) NewAnteHandlerOptions(appOpts servertypes.AppOptions) ante.HandlerOptions

func (*AltheaApp) RegisterAPIRoutes

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

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

func (*AltheaApp) RegisterTendermintService

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

RegisterTendermintService registers the /cosmos.base.tendermint.v1beta1.Service query endpoints on the baseapp's gRPC query router

func (*AltheaApp) RegisterTxService

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

RegisterTxService registers all Protobuf-based Tx receiving gRPC services based on what is registered in the interface registry. These are stapled on to the baseapp's gRPC Query router

func (*AltheaApp) SimulationManager

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

SimulationManager implements the SimulationApp interface

func (AltheaApp) ValidateMembers

func (app AltheaApp) ValidateMembers()

ValidateMembers checks for unexpected values, typically nil values needed for the chain to operate nolint: gocyclo

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 SimGenesisAccount

type SimGenesisAccount struct {
	*authtypes.BaseAccount

	// vesting account fields
	OriginalVesting  sdk.Coins `json:"original_vesting" yaml:"original_vesting"`   // total vesting coins upon initialization
	DelegatedFree    sdk.Coins `json:"delegated_free" yaml:"delegated_free"`       // delegated vested coins at time of delegation
	DelegatedVesting sdk.Coins `json:"delegated_vesting" yaml:"delegated_vesting"` // delegated vesting coins at time of delegation
	StartTime        int64     `json:"start_time" yaml:"start_time"`               // vesting start time (UNIX Epoch time)
	EndTime          int64     `json:"end_time" yaml:"end_time"`                   // vesting end time (UNIX Epoch time)

	// module account fields
	ModuleName        string   `json:"module_name" yaml:"module_name"`               // name of the module account
	ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module account
}

SimGenesisAccount defines a type that implements the GenesisAccount interface to be used for simulation accounts in the genesis state.

func (SimGenesisAccount) Validate

func (sga SimGenesisAccount) Validate() error

Validate checks for errors on the vesting and module account parameters

Directories

Path Synopsis
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
Package ante defines the SDK auth module's AnteHandler as well as an internal AnteHandler for an Ethereum transaction (i.e MsgEthereumTx).
Package params defines the simulation parameters in the gaia.
Package params defines the simulation parameters in the gaia.

Jump to

Keyboard shortcuts

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