app

package
v0.0.0-...-dcdc338 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 132 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "bitosd"

Name defines the application binary name

Variables

View Source
var (
	// MainnetMinGasPrices defines 20B abit (or abit) as the minimum gas price value on the fee market module.
	MainnetMinGasPrices = sdk.NewDec(20_000_000_000)
	// MainnetMinGasMultiplier defines the min gas multiplier value on the fee market module.
	// 50% of the leftover gas will be refunded
	MainnetMinGasMultiplier = sdk.NewDecWithPrec(5, 1)
)
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 Bitos testing.

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

DefaultTestingAppInit defines the IBC application used for testing

Functions

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 NewDefaultGenesisState

func NewDefaultGenesisState() simapp.GenesisState

NewDefaultGenesisState generates the default state for the application.

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() (ibctesting.TestingApp, map[string]json.RawMessage)

SetupTestingApp initializes the IBC-go testing application

func SigVerificationGasConsumer

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

SigVerificationGasConsumer is the Bitos 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 Bitos

type Bitos 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
	EvidenceKeeper   evidencekeeper.Keeper
	TransferKeeper   ibctransferkeeper.Keeper

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

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

	// Bitos keepers
	InflationKeeper  inflationkeeper.Keeper
	Erc20Keeper      erc20keeper.Keeper
	IncentivesKeeper incentiveskeeper.Keeper
	EpochsKeeper     epochskeeper.Keeper
	VestingKeeper    vestingkeeper.Keeper
	// contains filtered or unexported fields
}

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

func NewBitos

func NewBitos(
	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),
) *Bitos

NewBitos returns a reference to a new initialized Ethermint application.

func Setup

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

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

func (*Bitos) AppCodec

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

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

func (app *Bitos) 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 (*Bitos) BlockedAddrs

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

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

func (*Bitos) DeliverTx

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

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

func (*Bitos) EndBlocker

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

EndBlocker updates every end block

func (*Bitos) ExportAppStateAndValidators

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

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

func (*Bitos) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*Bitos) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*Bitos) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*Bitos) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*Bitos) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*Bitos) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*Bitos) InitChainer

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

InitChainer updates at chain initialization

func (*Bitos) InterfaceRegistry

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

InterfaceRegistry returns Bitos's InterfaceRegistry

func (*Bitos) LegacyAmino

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

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

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

LoadHeight loads state at a particular height

func (*Bitos) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*Bitos) Name

func (app *Bitos) Name() string

Name returns the name of the App

func (*Bitos) RegisterAPIRoutes

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

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

func (*Bitos) RegisterTendermintService

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

func (*Bitos) RegisterTxService

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

func (*Bitos) ScheduleForkUpgrade

func (app *Bitos) 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 (*Bitos) SimulationManager

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

SimulationManager implements the SimulationApp interface

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

Jump to

Keyboard shortcuts

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