Documentation ¶
Index ¶
- Constants
- Variables
- func AllWasmCapabilities() []string
- func BlockedAddresses() map[string]bool
- func DesmosWasmGasRegister() wasmtypes.WasmGasRegisterConfig
- func GetMaccPerms() map[string][]string
- func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string)
- func GetStargateAcceptedQueries() wasmkeeper.AcceptedStargateQueries
- func GetWasmOpts(appOpts servertypes.AppOptions, grpcQueryRouter *baseapp.GRPCQueryRouter, ...) []wasmkeeper.Option
- func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
- func MakeEncodingConfig() simappparams.EncodingConfig
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasmkeeper.MessageEncoders
- func NewDesmosCustomQueryPlugin(cdc codec.Codec, grpcQueryRouter *baseapp.GRPCQueryRouter, ...) wasmkeeper.QueryPlugins
- func NewDesmosWasmGasRegister() wasmtypes.WasmGasRegister
- func NewPostHandler() (sdk.PostHandler, error)
- func SetupConfig(config *sdk.Config)
- type DesmosApp
- func (app *DesmosApp) AppCodec() codec.Codec
- func (app *DesmosApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *DesmosApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *DesmosApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *DesmosApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *DesmosApp) LegacyAmino() *codec.LegacyAmino
- func (app *DesmosApp) Name() string
- func (app *DesmosApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *DesmosApp) SimulationManager() *module.SimulationManager
- func (app *DesmosApp) TxConfig() client.TxConfig
- type GenesisState
- type HandlerOptions
Constants ¶
const ( Bech32MainPrefix = "desmos" CoinType = 852 FullFundraiserPath = "44'/852'/0'/0/0" )
const ( // DefaultDesmosInstanceCost is how much SDK gas we charge each time we load a WASM instance DefaultDesmosInstanceCost uint64 = 60_000 // DefaultDesmosCompileCost is how much SDK gas is charged *per byte* for compiling WASM code DefaultDesmosCompileCost uint64 = 2 )
Variables ¶
var ( // DefaultNodeHome sets the folder where the application data and configuration will be stored DefaultNodeHome string // ModuleBasics is in charge of setting up basic module elements ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( []govclient.ProposalHandler{ paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, }, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, authzmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, consensus.AppModuleBasic{}, wasm.AppModuleBasic{}, ibc.AppModuleBasic{}, solomachine.AppModuleBasic{}, ibctm.AppModuleBasic{}, ibctransfer.AppModuleBasic{}, ibcfee.AppModuleBasic{}, ica.AppModuleBasic{}, profiles.AppModuleBasic{}, relationships.AppModuleBasic{}, subspaces.AppModuleBasic{}, posts.AppModuleBasic{}, reports.AppModuleBasic{}, reactions.AppModuleBasic{}, supply.AppModuleBasic{}, tokenfactory.AppModuleBasic{}, ) )
var ( // application configuration (used by depinject) AppConfig = appconfig.Compose(&appv1alpha1.Config{ Modules: []*appv1alpha1.ModuleConfig{ { Name: "runtime", Config: appconfig.WrapAny(&runtimev1alpha1.Module{ AppName: appName, BeginBlockers: beginBlockerOrder, EndBlockers: endBlockerOrder, OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{ { ModuleName: authtypes.ModuleName, KvStoreKey: "acc", }, }, InitGenesis: genesisModuleOrder, OrderMigrations: migrationModuleOrder, }), }, { Name: authtypes.ModuleName, Config: appconfig.WrapAny(&authmodulev1.Module{ Bech32Prefix: sdk.Bech32MainPrefix, ModuleAccountPermissions: maccPerms, }), }, { Name: vestingtypes.ModuleName, Config: appconfig.WrapAny(&vestingmodulev1.Module{}), }, { Name: banktypes.ModuleName, Config: appconfig.WrapAny(&bankmodulev1.Module{ BlockedModuleAccountsOverride: blockAccAddrs, }), }, { Name: stakingtypes.ModuleName, Config: appconfig.WrapAny(&stakingmodulev1.Module{}), }, { Name: slashingtypes.ModuleName, Config: appconfig.WrapAny(&slashingmodulev1.Module{}), }, { Name: paramstypes.ModuleName, Config: appconfig.WrapAny(¶msmodulev1.Module{}), }, { Name: "tx", Config: appconfig.WrapAny(&txconfigv1.Config{}), }, { Name: genutiltypes.ModuleName, Config: appconfig.WrapAny(&genutilmodulev1.Module{}), }, { Name: authz.ModuleName, Config: appconfig.WrapAny(&authzmodulev1.Module{}), }, { Name: upgradetypes.ModuleName, Config: appconfig.WrapAny(&upgrademodulev1.Module{}), }, { Name: distrtypes.ModuleName, Config: appconfig.WrapAny(&distrmodulev1.Module{}), }, { Name: capabilitytypes.ModuleName, Config: appconfig.WrapAny(&capabilitymodulev1.Module{ SealKeeper: true, }), }, { Name: evidencetypes.ModuleName, Config: appconfig.WrapAny(&evidencemodulev1.Module{}), }, { Name: minttypes.ModuleName, Config: appconfig.WrapAny(&mintmodulev1.Module{}), }, { Name: feegrant.ModuleName, Config: appconfig.WrapAny(&feegrantmodulev1.Module{}), }, { Name: govtypes.ModuleName, Config: appconfig.WrapAny(&govmodulev1.Module{}), }, { Name: crisistypes.ModuleName, Config: appconfig.WrapAny(&crisismodulev1.Module{}), }, { Name: consensustypes.ModuleName, Config: appconfig.WrapAny(&consensusmodulev1.Module{}), }, { Name: poststypes.ModuleName, Config: appconfig.WrapAny(&postsmodulev1.Module{}), }, { Name: profilestypes.ModuleName, Config: appconfig.WrapAny(&profilesmodulev1.Module{}), }, { Name: reactionstypes.ModuleName, Config: appconfig.WrapAny(&reactionsmodulev1.Module{}), }, { Name: relationshipstypes.ModuleName, Config: appconfig.WrapAny(&relationshipsmodulev1.Module{}), }, { Name: reportstypes.ModuleName, Config: appconfig.WrapAny(&reportsmodulev1.Module{}), }, { Name: subspacestypes.ModuleName, Config: appconfig.WrapAny(&subspacesmodulev1.Module{}), }, { Name: supplytypes.ModuleName, Config: appconfig.WrapAny(&supplymodulev1.Module{}), }, { Name: tokenfactorytypes.ModuleName, Config: appconfig.WrapAny(&tokenfactorymodulev1.Module{}), }, }, }) )
Functions ¶
func AllWasmCapabilities ¶ added in v6.2.0
func AllWasmCapabilities() []string
AllWasmCapabilities 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 DesmosWasmGasRegister ¶
func DesmosWasmGasRegister() wasmtypes.WasmGasRegisterConfig
DesmosWasmGasRegister is defaults plus a custom compile amount
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func GetSimulationLog ¶
func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string)
GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the each's module store key and the prefix bytes of the KVPair's key.
func GetStargateAcceptedQueries ¶
func GetStargateAcceptedQueries() wasmkeeper.AcceptedStargateQueries
GetStargateAcceptedQueries returns the stargate accepted queries
func GetWasmOpts ¶
func GetWasmOpts( appOpts servertypes.AppOptions, grpcQueryRouter *baseapp.GRPCQueryRouter, cdc codec.Codec, profilesKeeper *profileskeeper.Keeper, subspacesKeeper *subspaceskeeper.Keeper, relationshipsKeeper relationshipskeeper.Keeper, postsKeeper *postskeeper.Keeper, reportsKeeper reportskeeper.Keeper, reactionsKeeper reactionskeeper.Keeper, ) []wasmkeeper.Option
GetWasmOpts parses appOpts and add wasm opt to the given options array. if telemetry is enabled, the wasmVM cache metrics are activated.
func MakeCodecs ¶
func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by DesmosApp. It is useful for tests and clients who do not want to construct the full DesmosApp
func MakeEncodingConfig ¶
func MakeEncodingConfig() simappparams.EncodingConfig
MakeEncodingConfig creates an EncodingConfig for testing
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func NewDesmosCustomMessageEncoder ¶
func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasmkeeper.MessageEncoders
NewDesmosCustomMessageEncoder initialize the custom message encoder to desmos app for contracts
func NewDesmosCustomQueryPlugin ¶
func NewDesmosCustomQueryPlugin( cdc codec.Codec, grpcQueryRouter *baseapp.GRPCQueryRouter, profilesKeeper *profileskeeper.Keeper, subspacesKeeper *subspaceskeeper.Keeper, relationshipsKeeper relationshipskeeper.Keeper, postsKeeper *postskeeper.Keeper, reportsKeeper reportskeeper.Keeper, reactionsKeeper reactionskeeper.Keeper, ) wasmkeeper.QueryPlugins
NewDesmosCustomQueryPlugin initialize the custom querier to handle desmos queries for contracts
func NewDesmosWasmGasRegister ¶
func NewDesmosWasmGasRegister() wasmtypes.WasmGasRegister
func NewPostHandler ¶
func NewPostHandler() (sdk.PostHandler, error)
NewPostHandler returns an empty PostHandler chain. PostHandler is like AnteHandler but it executes after RunMsgs.
func SetupConfig ¶
SetupConfig sets up the given config as it should be for Desmos
Types ¶
type DesmosApp ¶
type DesmosApp struct { *runtime.App // Keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper 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 AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper WasmKeeper wasmkeeper.Keeper // IBC modules TransferKeeper ibctransferkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly IBCFeeKeeper ibcfeekeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper ScopedProfilesKeeper capabilitykeeper.ScopedKeeper ScopedWasmKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper // Custom modules SubspacesKeeper *subspaceskeeper.Keeper ProfilesKeeper *profileskeeper.Keeper RelationshipsKeeper relationshipskeeper.Keeper PostsKeeper *postskeeper.Keeper ReportsKeeper reportskeeper.Keeper ReactionsKeeper reactionskeeper.Keeper SupplyKeeper supplykeeper.Keeper TokenFactoryKeeper tokenfactorykeeper.Keeper // contains filtered or unexported fields }
DesmosApp extends an ABCI application, but with most of its parameters exported. They are exported for convenience in creating helper functions, as object capabilities aren't needed for testing.
func NewDesmosApp ¶
func (*DesmosApp) AppCodec ¶
AppCodec returns DesmosApp'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 (*DesmosApp) ExportAppStateAndValidators ¶
func (app *DesmosApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*DesmosApp) GetKey ¶
func (app *DesmosApp) 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 (*DesmosApp) GetSubspace ¶
func (app *DesmosApp) 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 (*DesmosApp) InterfaceRegistry ¶
func (app *DesmosApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns DesmosApp's InterfaceRegistry
func (*DesmosApp) LegacyAmino ¶
func (app *DesmosApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns DesmosApp'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 (*DesmosApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*DesmosApp) SimulationManager ¶
func (app *DesmosApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState represents the genesis state of the blockchain 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(cdc codec.JSONCodec) GenesisState
NewDefaultGenesisState generates the default state for the application.
type HandlerOptions ¶
type HandlerOptions struct { ante.HandlerOptions IBCkeeper *ibckeeper.Keeper SubspacesKeeper subspaceskeeper.Keeper TxCounterStoreKey storetypes.StoreKey WasmConfig *wasmTypes.WasmConfig }
HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.