app

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: LGPL-3.0 Imports: 146 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "bbcored"

Name defines the application binary name

Variables

View Source
var (
	MainnetMinGasPrices = math.LegacyNewDec(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 = math.LegacyNewDecWithPrec(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

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

DefaultTestingAppInit defines the IBC application used for testing

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

EthDefaultConsensusParams defines the default Tendermint consensus params used in

Functions

func GenesisStateWithValSet

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

func NewBurnDecorator

func NewBurnDecorator(feeCollector string, bankKeeper bankkeeper.Keeper) sdk.PostDecorator

NewBurnDecorator creates a new instance of the BurnDecorator.

func NewDefaultGenesisState

func NewDefaultGenesisState() simapp.GenesisState

NewDefaultGenesisState generates the default state for the application.

func NewPostHandler

func NewPostHandler(ho HandlerOptions) sdk.PostHandler

NewPostHandler returns a new PostHandler decorators chain.

func NewTestGenesisState

func NewTestGenesisState(codec codec.Codec) simapp.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 need to keep this design to comply with the ibctesting SetupTestingApp func and be able to set the chainID for the tests properly

func StoreKeys

StoreKeys returns the application store keys, the EVM transient store keys and the memory store keys

Types

type BounceBit

type BounceBit 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
	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
	ConsensusParamsKeeper consensusparamkeeper.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper      capabilitykeeper.ScopedKeeper
	ScopedTransferKeeper capabilitykeeper.ScopedKeeper
	EvmKeeper            *evmkeeper.Keeper
	FeeMarketKeeper      feemarketkeeper.Keeper
	InflationKeeper      inflationkeeper.Keeper
	VestingKeeper        vestingkeeper.Keeper
	EpochsKeeper         epochskeeper.Keeper
	// contains filtered or unexported fields
}

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

func EthSetup

func EthSetup(isCheckTx bool, patchGenesis func(*BounceBit, simapp.GenesisState) simapp.GenesisState) *BounceBit

EthSetup initializes a new app

func EthSetupWithDB

func EthSetupWithDB(isCheckTx bool, patchGenesis func(*BounceBit, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *BounceBit

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

func NewBounceBit

func NewBounceBit(
	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),
) *BounceBit

NewBounceBit returns a reference to a new initialized BounceBit application.

func Setup

func Setup(isCheckTx bool, feemarketGenesis *feemarkettypes.GenesisState, chainID string) *BounceBit

func (*BounceBit) AppCodec

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

AppCodec 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 (*BounceBit) BeginBlocker

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

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

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

func (*BounceBit) Close

func (app *BounceBit) Close() error

func (*BounceBit) DeliverTx

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

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

func (*BounceBit) EndBlocker

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

EndBlocker updates every end block

func (*BounceBit) ExportAppStateAndValidators

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

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

func (*BounceBit) GetBaseApp

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

GetBaseApp implements the TestingApp interface.

func (*BounceBit) GetIBCKeeper

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

GetIBCKeeper implements the TestingApp interface.

func (*BounceBit) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely used for testing purposes.

func (*BounceBit) GetScopedIBCKeeper

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

GetScopedIBCKeeper implements the TestingApp interface.

func (*BounceBit) GetStakingKeeper

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

GetStakingKeeper implements the TestingApp interface.

func (*BounceBit) GetStakingKeeperSDK

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

GetStakingKeeperSDK implements the TestingApp interface.

func (*BounceBit) GetSubspace

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

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

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

GetTxConfig implements the TestingApp interface.

func (*BounceBit) InitChainer

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

InitChainer updates at chain initialization

func (*BounceBit) InterfaceRegistry

func (app *BounceBit) InterfaceRegistry() codectypes.InterfaceRegistry

InterfaceRegistry

func (*BounceBit) LegacyAmino

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

LegacyAmino 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 (*BounceBit) LoadHeight

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

LoadHeight loads state at a particular height

func (*BounceBit) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*BounceBit) Name

func (app *BounceBit) Name() string

Name returns the name of the App

func (*BounceBit) RegisterAPIRoutes

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

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

func (*BounceBit) RegisterNodeService

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

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

func (*BounceBit) RegisterTendermintService

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

RegisterTendermintService implements the Application.RegisterTendermintService method.

func (*BounceBit) RegisterTxService

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

func (*BounceBit) SimulationManager

func (*BounceBit) SimulationManager() *module.SimulationManager

SimulationManager implements runtime.AppI

type BurnDecorator

type BurnDecorator struct {
	// contains filtered or unexported fields
}

BurnDecorator is the decorator that burns all the transaction fees from Cosmos transactions.

func (BurnDecorator) PostHandle

func (bd BurnDecorator) PostHandle(ctx sdk.Context, tx sdk.Tx, simulate, success bool, next sdk.PostHandler) (newCtx sdk.Context, err error)

PostHandle burns all the transaction fees from Cosmos transactions. If an Ethereum transaction is present, this logic is skipped.

type HandlerOptions

type HandlerOptions struct {
	FeeCollectorName string
	BankKeeper       bankkeeper.Keeper
}

HandlerOptions are the options required for constructing a PostHandler.

func (HandlerOptions) Validate

func (h HandlerOptions) Validate() error

Directories

Path Synopsis
upgrades

Jump to

Keyboard shortcuts

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