Documentation
¶
Index ¶
- Variables
- func AllCapabilities() []string
- func GetEnabledProposals() []wasm.ProposalType
- func GetMaccPerms() map[string][]string
- func MakeEncodingConfig() appparams.EncodingConfig
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func Recover(logger tmlog.Logger, err *error)
- func RegisterStargateQueries(queryRouter baseapp.GRPCQueryRouter, codec codec.Codec) []wasmkeeper.Option
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error)
- type EvmOptions
- type GenesisState
- type HandlerOptions
- type OraichainApp
- func (app *OraichainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *OraichainApp) BlockedAddrs() map[string]bool
- func (app *OraichainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *OraichainApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *OraichainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *OraichainApp) LegacyAmino() *codec.LegacyAmino
- func (app *OraichainApp) LoadHeight(height int64) error
- func (app *OraichainApp) ModuleAccountAddrs() map[string]bool
- func (app *OraichainApp) Name() string
- func (app *OraichainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *OraichainApp) RegisterNodeService(clientCtx client.Context)
- func (app *OraichainApp) RegisterTendermintService(clientCtx client.Context)
- func (app *OraichainApp) RegisterTxService(clientCtx client.Context)
- func (app *OraichainApp) SimulationManager() *module.SimulationManager
Constants ¶
This section is empty.
Variables ¶
var ( NodeDir = ".oraid" BinaryVersion = "v0.42.4" // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. ProposalsEnabled = "true" // If set to non-empty string it must be comma-separated list of values that are all a subset // of "EnableAllProposals" (takes precedence over ProposalsEnabled) // https://github.com/oraichain/orai/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" EnabledCapabilities = []string{ tokenfactorytypes.EnableBurnFrom, tokenfactorytypes.EnableSetMetadata, } )
We pull these out so we can set them with LDFLAGS in the Makefile
var ( // DefaultNodeHome default home directories for wasmd DefaultNodeHome = os.ExpandEnv("$PWD/") + NodeDir // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = appconfig.Bech32Prefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = appconfig.Bech32Prefix + sdk.PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = appconfig.Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = appconfig.Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = appconfig.Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = appconfig.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 DefaultEvmOptions = EvmOptions{ EVMTrace: ethermintconfig.DefaultEVMTracer, EVMMaxGasWanted: ethermintconfig.DefaultMaxTxGasWanted, }
DefaultOptions is a sensible default Options value.
var ( // ModuleBasics defines the module BasicManager is in charge of setting up basic, // non-dependant module elements, such as codec registration // and genesis verification. ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( append( wasmclient.ProposalHandlers, paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, )..., ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, evm.AppModuleBasic{}, feemarket.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, wasm.AppModuleBasic{}, ica.AppModuleBasic{}, intertx.AppModuleBasic{}, ibcfee.AppModuleBasic{}, clock.AppModuleBasic{}, globalfee.AppModuleBasic{}, ibchooks.AppModuleBasic{}, packetforward.AppModuleBasic{}, evmutil.AppModuleBasic{}, tokenfactory.AppModuleBasic{}, ) )
Functions ¶
func AllCapabilities ¶ added in v0.42.4
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 GetEnabledProposals ¶
func GetEnabledProposals() []wasm.ProposalType
GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into wasmd app.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func MakeEncodingConfig ¶
func MakeEncodingConfig() appparams.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for gravity.
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
NewAnteHandler returns an 'AnteHandler' that will run actions before a tx is sent to a module's handler.
func RegisterStargateQueries ¶ added in v0.42.4
func RegisterStargateQueries(queryRouter baseapp.GRPCQueryRouter, codec codec.Codec) []wasmkeeper.Option
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func StargateQuerier ¶ added in v0.42.4
func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error)
StargateQuerier dispatches whitelisted stargate queries
Types ¶
type EvmOptions ¶ added in v0.42.4
type EvmOptions struct {
MempoolEnableAuth bool
MempoolAuthAddresses []sdk.AccAddress
EVMTrace string
EVMMaxGasWanted uint64
}
Options bundles several configuration params for an App.
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState default state for the application
func NewDefaultGenesisState ¶
func NewDefaultGenesisState(cdc codec.Codec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type HandlerOptions ¶
type HandlerOptions struct {
AccountKeeper evmtypes.AccountKeeper
BankKeeper evmtypes.BankKeeper
EvmKeeper evmante.EVMKeeper
FeegrantKeeper ante.FeegrantKeeper
GlobalFeeKeeper globalfeekeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer ante.SignatureVerificationGasConsumer
FeeMarketKeeper evmtypes.FeeMarketKeeper
MaxTxGasWanted uint64
IBCKeeper *keeper.Keeper
TxCounterStoreKey sdk.StoreKey
WasmConfig wasmTypes.WasmConfig
Cdc codec.BinaryCodec
BypassMinFeeMsgTypes []string
}
HandlerOptions extends the SDK's AnteHandler options by requiring the IBC channel keeper.
func (HandlerOptions) Validate ¶ added in v0.42.4
func (options HandlerOptions) Validate() error
type OraichainApp ¶
type OraichainApp struct {
*baseapp.BaseApp
// keepers
AccountKeeper authkeeper.AccountKeeper
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 // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
EvmKeeper *evmkeeper.Keeper
EvmutilKeeper evmutilkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasm.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
ClockKeeper clockkeeper.Keeper
GlobalFeeKeeper globalfeekeeper.Keeper
TokenFactoryKeeper tokenfactorykeeper.Keeper
IbcFeeKeeper ibcfeekeeper.Keeper
IBCHooksKeeper *ibchookskeeper.Keeper
IcaControllerKeeper icacontrollerkeeper.Keeper
IcaHostKeeper icahostkeeper.Keeper
InterTxKeeper intertxkeeper.Keeper
// Middleware wrapper
Ics20WasmHooks *ibchooks.WasmHooks
HooksICS4Wrapper ibchooks.ICS4Middleware
PacketForwardKeeper *packetforwardkeeper.Keeper
// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
// scopedIBCFeeKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedInterTxKeeper capabilitykeeper.ScopedKeeper
// contains filtered or unexported fields
}
OraichainApp extended ABCI application
func NewOraichainApp ¶
func NewOraichainApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, enabledProposals []wasm.ProposalType, appOpts servertypes.AppOptions, wasmOpts []wasm.Option, options EvmOptions, baseAppOptions ...func(*baseapp.BaseApp)) *OraichainApp
NewOraichainApp returns a reference to an initialized OraichainApp.
func (*OraichainApp) BeginBlocker ¶
func (app *OraichainApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
application updates every begin block
func (*OraichainApp) BlockedAddrs ¶
func (app *OraichainApp) BlockedAddrs() map[string]bool
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*OraichainApp) EndBlocker ¶
func (app *OraichainApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*OraichainApp) ExportAppStateAndValidators ¶
func (app *OraichainApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*OraichainApp) InitChainer ¶
func (app *OraichainApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*OraichainApp) LegacyAmino ¶
func (app *OraichainApp) 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 (*OraichainApp) LoadHeight ¶
func (app *OraichainApp) LoadHeight(height int64) error
LoadHeight loads a particular height
func (*OraichainApp) ModuleAccountAddrs ¶
func (app *OraichainApp) ModuleAccountAddrs() map[string]bool
ModuleAccountAddrs returns all the app's module account addresses.
func (*OraichainApp) RegisterAPIRoutes ¶
func (app *OraichainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*OraichainApp) RegisterNodeService ¶
func (app *OraichainApp) RegisterNodeService(clientCtx client.Context)
func (*OraichainApp) RegisterTendermintService ¶
func (app *OraichainApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*OraichainApp) RegisterTxService ¶
func (app *OraichainApp) RegisterTxService(clientCtx client.Context)
RegisterTxService implements the Application.RegisterTxService method.
func (*OraichainApp) SimulationManager ¶
func (app *OraichainApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface