Documentation
¶
Index ¶
- Constants
- Variables
- func AddTestAddrsIncremental(app *ChainApp, ctx sdk.Context, accNum int, accAmt sdkmath.Int) []sdk.AccAddress
- func AllCapabilities() []string
- func BlockedAddresses() map[string]bool
- func EVMAppOptions(chainID string) error
- func GenAccount() account
- func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func GetInterfaceRegistry() types.InterfaceRegistry
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig(t testing.TB) params.EncodingConfig
- func NewAvailableStaticPrecompiles(stakingKeeper stakingkeeper.Keeper, ...) map[common.Address]vm.PrecompiledContract
- func NewTestNetworkFixture() network.TestFixture
- func NoOpEVMOptions(_ string) error
- func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, ...) (*abci.ResponseFinalizeBlock, error)
- type CallbacksCompatibleModule
- type ChainApp
- func NewChainApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, ...) *ChainApp
- func NewChainAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *ChainApp
- func Setup(t *testing.T, wasmOpts ...wasmkeeper.Option) *ChainApp
- func SetupWithEmptyStore(t testing.TB) *ChainApp
- func SetupWithGenesisValSet(t *testing.T, valSet *cmttypes.ValidatorSet, ...) *ChainApp
- func (app *ChainApp) AppCodec() codec.Codec
- func (app *ChainApp) AutoCliOpts() autocli.AppOptions
- func (app *ChainApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (a *ChainApp) Configurator() module.Configurator
- func (a *ChainApp) DefaultGenesis() map[string]json.RawMessage
- func (app *ChainApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *ChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *ChainApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
- func (app *ChainApp) GetAccountKeeper() authkeeper.AccountKeeper
- func (app *ChainApp) GetBankKeeper() bankkeeper.Keeper
- func (app *ChainApp) GetBaseApp() *baseapp.BaseApp
- func (app *ChainApp) GetIBCKeeper() *ibckeeper.Keeper
- func (app *ChainApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *ChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *ChainApp) GetMempool() sdkmempool.ExtMempool
- func (app *ChainApp) GetStakingKeeper() *stakingkeeper.Keeper
- func (app *ChainApp) GetStoreKeys() []storetypes.StoreKey
- func (app *ChainApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *ChainApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *ChainApp) GetWasmKeeper() wasmkeeper.Keeper
- func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *ChainApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *ChainApp) LegacyAmino() *codec.LegacyAmino
- func (app *ChainApp) LoadHeight(height int64) error
- func (app *ChainApp) Name() string
- func (app *ChainApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *ChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *ChainApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *ChainApp) RegisterPendingTxListener(listener func(common.Hash))
- func (app *ChainApp) RegisterTendermintService(clientCtx client.Context)
- func (app *ChainApp) RegisterTxService(clientCtx client.Context)
- func (app *ChainApp) RegisterUpgradeHandlers()
- func (app *ChainApp) SetClientCtx(clientCtx client.Context)
- func (app *ChainApp) SimulationManager() *module.SimulationManager
- func (app *ChainApp) TxConfig() client.TxConfig
- type EVMOptionsFn
- type GenesisState
- type Option
- type Optionals
- type PacketDataUnmarshaler
- type SetupOptions
Constants ¶
const ( NodeDir = ".pchain" Bech32Prefix = "push" ChainID = "push_42101-1" EVMChainID = uint64(42101) )
const WTokenContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517"
WTokenContractMainnet is the WrappedToken contract address for mainnet
Variables ¶
var ( // DefaultNodeHome default home directories for appd DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir CoinType uint32 = 60 BaseDenomUnit int64 = 18 BaseDenom = pushtypes.BaseDenom DisplayDenom = pushtypes.DisplayDenom // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = Bech32Prefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic )
These constants are derived from the above variables. These are the ones we will want to use in the code, based on any overrides above
var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{ ChainID: { Denom: BaseDenom, ExtendedDenom: BaseDenom, DisplayDenom: DisplayDenom, Decimals: evmtypes.EighteenDecimals.Uint32(), }, }
ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo that allows initializing the app with different coin info based on the chain id
var ExampleTokenPairs = []erc20types.TokenPair{ { Erc20Address: WTokenContractMainnet, Denom: BaseDenom, Enabled: true, ContractOwner: erc20types.OWNER_MODULE, }, }
ExampleTokenPairs creates a slice of token pairs, that contains a pair for the native denom of the example chain implementation.
var Upgrades = []upgrades.Upgrade{ feeabs.NewUpgrade(), solanafix.NewUpgrade(), ethhashfix.NewUpgrade(), gasoracle.NewUpgrade(), pcmintcap.NewUpgrade(), tsscore.NewUpgrade(), tsscorefix.NewUpgrade(), tsscoreevmparamsfix.NewUpgrade(), evmrpcfix.NewUpgrade(), evmblockscoutfix.NewUpgrade(), tssvotegasless.NewUpgrade(), removefeeabsv1.NewUpgrade(), outbound.NewUpgrade(), universaltxv1.NewUpgrade(), proxybytecodefix.NewUpgrade(), supplyslash.NewUpgrade(), supplyburn.NewUpgrade(), chainmeta.NewUpgrade(), chainmetavotegasless.NewUpgrade(), ceagasandpayload.NewUpgrade(), ceapayloadverificationfix.NewUpgrade(), aiauditfixes.NewUpgrade(), aiauditfixes2.NewUpgrade(), ueamigration.NewUpgrade(), tssmigration.NewUpgrade(), purgeexpiredoutbounds.NewUpgrade(), removeutxverifier.NewUpgrade(), tssfundmigrationfixes.NewUpgrade(), contractauditchanges.NewUpgrade(), evmv040.NewUpgrade(), evmparamsmigration.NewUpgrade(), evmchainidffix.NewUpgrade(), evmpreinstalls.NewUpgrade(), evmv050.NewUpgrade(), securityauditfixes.NewUpgrade(), evmv060.NewUpgrade(), }
Upgrades list of chain upgrades
Functions ¶
func AddTestAddrsIncremental ¶
func AddTestAddrsIncremental(app *ChainApp, ctx sdk.Context, accNum int, accAmt sdkmath.Int) []sdk.AccAddress
AddTestAddrsIncremental constructs and returns accNum amount of accounts with an initial balance of accAmt in random order
func AllCapabilities ¶
func AllCapabilities() []string
AllCapabilities returns all capabilities available with the current wasmvm See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md This functionality is going to be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425
func BlockedAddresses ¶
BlockedAddresses returns all the app's blocked account addresses.
func EVMAppOptions ¶
EVMAppOptions allows to setup the global configuration for the chain.
func GenAccount ¶
func GenAccount() account
func GenesisStateWithValSet ¶
func GenesisStateWithValSet( codec codec.Codec, genesisState map[string]json.RawMessage, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, ) (map[string]json.RawMessage, error)
GenesisStateWithValSet returns a new genesis state with the validator set copied from simtestutil with delegation not added to supply
func GetInterfaceRegistry ¶
func GetInterfaceRegistry() types.InterfaceRegistry
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
NOTE: This is solely to be used for testing purposes.
func MakeEncodingConfig ¶
func MakeEncodingConfig(t testing.TB) params.EncodingConfig
MakeEncodingConfig creates a new EncodingConfig with all modules registered. For testing only
func NewAvailableStaticPrecompiles ¶
func NewAvailableStaticPrecompiles( stakingKeeper stakingkeeper.Keeper, distributionKeeper distributionkeeper.Keeper, bankKeeper cmn.BankKeeper, erc20Kpr *erc20Keeper.Keeper, transferKeeper *transferkeeper.Keeper, channelKeeper *channelkeeper.Keeper, govKeeper govkeeper.Keeper, slashingKeeper slashingkeeper.Keeper, appCodec codec.Codec, opts ...Option, ) map[common.Address]vm.PrecompiledContract
NewAvailableStaticPrecompiles returns the list of all available static precompiled contracts.
NOTE: this should only be used during initialization of the Keeper.
func NewTestNetworkFixture ¶
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new ChainApp AppConstructor for network simulation tests
func NoOpEVMOptions ¶
NoOpEVMOptions is a no-op function that can be used when the app does not need any specific configuration.
func SignAndDeliverWithoutCommit ¶
func SignAndDeliverWithoutCommit(t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, msgs []sdk.Msg, fees sdk.Coins, chainID string, accNums, accSeqs []uint64, blockTime time.Time, priv ...cryptotypes.PrivKey) (*abci.ResponseFinalizeBlock, error)
SignAndDeliverWithoutCommit signs and delivers a transaction. No commit
Types ¶
type CallbacksCompatibleModule ¶
type CallbacksCompatibleModule interface {
porttypes.IBCModule
porttypes.PacketDataUnmarshaler
}
type ChainApp ¶
type ChainApp struct {
*baseapp.BaseApp
// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.BaseKeeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
GroupKeeper groupkeeper.Keeper
NFTKeeper nftkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
CircuitKeeper circuitkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
// Custom
WasmKeeper wasmkeeper.Keeper
TokenFactoryKeeper tokenfactorykeeper.Keeper
PacketForwardKeeper *packetforwardkeeper.Keeper
WasmClientKeeper wasmlckeeper.Keeper
RatelimitKeeper ratelimitkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
EVMKeeper *evmkeeper.Keeper
Erc20Keeper erc20keeper.Keeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
UexecutorKeeper uexecutorkeeper.Keeper
UregistryKeeper uregistrykeeper.Keeper
UvalidatorKeeper uvalidatorkeeper.Keeper
UtssKeeper utsskeeper.Keeper
// the module manager
ModuleManager *module.Manager
BasicModuleManager module.BasicManager
// contains filtered or unexported fields
}
ChainApp extended ABCI application
func NewChainApp ¶
func NewChainApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, cosmosevmAppOptions EVMOptionsFn, baseAppOptions ...func(*baseapp.BaseApp), ) *ChainApp
NewChainApp returns a reference to an initialized ChainApp.
func NewChainAppWithCustomOptions ¶
func NewChainAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *ChainApp
NewChainAppWithCustomOptions initializes a new ChainApp with custom options.
func Setup ¶
func Setup( t *testing.T, wasmOpts ...wasmkeeper.Option, ) *ChainApp
Setup initializes a new ChainApp. A Nop logger is set in ChainApp.
func SetupWithEmptyStore ¶
SetupWithEmptyStore set up a chain app instance with empty DB
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet( t *testing.T, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, wasmOpts []wasmkeeper.Option, balances ...banktypes.Balance, ) *ChainApp
SetupWithGenesisValSet initializes a new ChainApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the ChainApp from first genesis account. A Nop logger is set in ChainApp.
func (*ChainApp) AppCodec ¶
AppCodec returns 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 (*ChainApp) AutoCliOpts ¶
func (app *ChainApp) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*ChainApp) BeginBlocker ¶
BeginBlocker application updates every begin block
func (*ChainApp) Configurator ¶
func (a *ChainApp) Configurator() module.Configurator
func (*ChainApp) DefaultGenesis ¶
func (a *ChainApp) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*ChainApp) EndBlocker ¶
EndBlocker application updates every end block
func (*ChainApp) ExportAppStateAndValidators ¶
func (app *ChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs, modulesToExport []string) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*ChainApp) FinalizeBlock ¶
func (app *ChainApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
func (*ChainApp) GetAccountKeeper ¶
func (app *ChainApp) GetAccountKeeper() authkeeper.AccountKeeper
func (*ChainApp) GetBankKeeper ¶
func (app *ChainApp) GetBankKeeper() bankkeeper.Keeper
func (*ChainApp) GetBaseApp ¶
func (*ChainApp) GetIBCKeeper ¶
func (*ChainApp) GetKey ¶
func (app *ChainApp) 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 (*ChainApp) GetMemKey ¶
func (app *ChainApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*ChainApp) GetMempool ¶ added in v0.0.39
func (app *ChainApp) GetMempool() sdkmempool.ExtMempool
GetMempool returns nil — push-chain does not use the EVM experimental mempool. This satisfies the evmserver.Application interface added in cosmos/evm v0.5.
func (*ChainApp) GetStakingKeeper ¶
func (app *ChainApp) GetStakingKeeper() *stakingkeeper.Keeper
func (*ChainApp) GetStoreKeys ¶
func (app *ChainApp) GetStoreKeys() []storetypes.StoreKey
GetStoreKeys returns all the stored store keys.
func (*ChainApp) GetSubspace ¶
func (app *ChainApp) 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 (*ChainApp) GetTKey ¶
func (app *ChainApp) 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 (*ChainApp) GetWasmKeeper ¶
func (app *ChainApp) GetWasmKeeper() wasmkeeper.Keeper
func (*ChainApp) InitChainer ¶
func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*ChainApp) InterfaceRegistry ¶
func (app *ChainApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns ChainApp's InterfaceRegistry
func (*ChainApp) LegacyAmino ¶
func (app *ChainApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns legacy 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 (*ChainApp) LoadHeight ¶
LoadHeight loads a particular height
func (*ChainApp) PreBlocker ¶
func (app *ChainApp) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates every pre block
func (*ChainApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*ChainApp) RegisterNodeService ¶
func (*ChainApp) RegisterPendingTxListener ¶ added in v0.0.37
RegisterPendingTxListener registers a listener for pending EVM transactions (required by evmserver.Application).
func (*ChainApp) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*ChainApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*ChainApp) RegisterUpgradeHandlers ¶
func (app *ChainApp) RegisterUpgradeHandlers()
RegisterUpgradeHandlers registers the chain upgrade handlers
func (*ChainApp) SetClientCtx ¶ added in v0.0.37
SetClientCtx sets the client context on the app (required by evmserver.Application).
func (*ChainApp) SimulationManager ¶
func (app *ChainApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type EVMOptionsFn ¶
EVMOptionsFn defines a function type for setting app options specifically for the app. The function should receive the chainID and return an error if any.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState 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 GenesisStateWithSingleValidator ¶
func GenesisStateWithSingleValidator(t *testing.T, app *ChainApp) GenesisState
GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts that also act as delegators.
type Option ¶ added in v0.0.37
type Option func(opts *Optionals)
func WithAddressCodec ¶ added in v0.0.37
func WithConsensusAddrCodec ¶ added in v0.0.37
func WithValidatorAddrCodec ¶ added in v0.0.37
type Optionals ¶ added in v0.0.37
type Optionals struct {
AddressCodec address.Codec
ValidatorAddrCodec address.Codec
ConsensusAddrCodec address.Codec
}
Optionals define some optional params that can be applied to _some_ precompiles.
type PacketDataUnmarshaler ¶
type SetupOptions ¶
type SetupOptions struct {
Logger log.Logger
DB *dbm.MemDB
AppOpts servertypes.AppOptions
WasmOpts []wasmkeeper.Option
}
SetupOptions defines arguments that are passed into `ChainApp` constructor.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package params defines the simulation parameters in the gaia.
|
Package params defines the simulation parameters in the gaia. |
|
evm-params-migration
Package evmparamsmigration contains the upgrade handler that migrates the x/vm module's on-chain Params from the v0.2.x proto layout to the v0.3.x layout.
|
Package evmparamsmigration contains the upgrade handler that migrates the x/vm module's on-chain Params from the v0.2.x proto layout to the v0.3.x layout. |