app

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 142 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Bech32MainPrefix = "desmos"

	CoinType           = 852
	FullFundraiserPath = "44'/852'/0'/0/0"
)
View Source
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

View Source
var (
	ProposalsEnabled = "false"

	EnableSpecificProposals = ""
)

Functions

func DesmosWasmGasRegister

func DesmosWasmGasRegister() wasmkeeper.WasmGasRegisterConfig

DesmosWasmGasRegister is defaults plus a custom compile amount

func GetEnabledProposals

func GetEnabledProposals() []wasm.ProposalType

GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into desmos app.

func GetMaccPerms

func GetMaccPerms() map[string][]string

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 GetWasmOpts

func GetWasmOpts(
	appOpts servertypes.AppOptions,
	cdc codec.Codec,
	profilesKeeper profileskeeper.Keeper,
	subspacesKeeper subspaceskeeper.Keeper,
	relationshipsKeeper relationshipskeeper.Keeper,
	postsKeeper postskeeper.Keeper,
	reportsKeeper reportskeeper.Keeper,
	reactionsKeeper reactionskeeper.Keeper,
) []wasm.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 MakeTestEncodingConfig

func MakeTestEncodingConfig() params.EncodingConfig

MakeTestEncodingConfig creates an EncodingConfig for testing

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

func NewDesmosCustomMessageEncoder

func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasm.MessageEncoders

NewDesmosCustomMessageEncoder initialize the custom message encoder to desmos app for contracts

func NewDesmosCustomQueryPlugin

func NewDesmosCustomQueryPlugin(
	cdc codec.Codec,
	profilesKeeper profileskeeper.Keeper,
	subspacesKeeper subspaceskeeper.Keeper,
	relationshipsKeeper relationshipskeeper.Keeper,
	postsKeeper postskeeper.Keeper,
	reportsKeeper reportskeeper.Keeper,
	reactionsKeeper reactionskeeper.Keeper,
) wasm.QueryPlugins

NewDesmosCustomQueryPlugin initialize the custom querier to handle desmos queries for contracts

func NewDesmosWasmGasRegister

func NewDesmosWasmGasRegister() wasmkeeper.WasmGasRegister

func RegisterSwaggerAPI

func RegisterSwaggerAPI(rtr *mux.Router)

RegisterSwaggerAPI registers swagger route with API Server

func SetupConfig

func SetupConfig(config *sdk.Config)

SetupConfig sets up the given config as it should be for Desmos

Types

type DesmosApp

type DesmosApp struct {
	*baseapp.BaseApp

	// 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
	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
	FeeGrantKeeper   feegrantkeeper.Keeper
	WasmKeeper       wasm.Keeper

	// make scoped keepers public for test purposes
	ScopedIBCKeeper         capabilitykeeper.ScopedKeeper
	ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper
	ScopedProfilesKeeper    capabilitykeeper.ScopedKeeper
	ScopedWasmKeeper        capabilitykeeper.ScopedKeeper

	// Custom modules
	FeesKeeper          feeskeeper.Keeper
	SubspacesKeeper     subspaceskeeper.Keeper
	ProfileKeeper       profileskeeper.Keeper
	RelationshipsKeeper relationshipskeeper.Keeper
	PostsKeeper         postskeeper.Keeper
	ReportsKeeper       reportskeeper.Keeper
	ReactionsKeeper     reactionskeeper.Keeper
	SupplyKeeper        supplykeeper.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 NewDesmosApp(
	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),
) *DesmosApp

NewDesmosApp is a constructor function for DesmosApp

func (*DesmosApp) AppCodec

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

AppCodec returns SimApp'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) BeginBlocker

func (app *DesmosApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker application updates every begin block

func (*DesmosApp) EndBlocker

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

EndBlocker application updates every end block

func (*DesmosApp) ExportAppStateAndValidators

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

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

func (*DesmosApp) GetKey

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

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

GetMemKey returns the MemStoreKey for the provided mem key.

NOTE: This is solely 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) GetTKey

func (app *DesmosApp) 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 (*DesmosApp) InitChainer

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

InitChainer application update.md at chain initialization

func (*DesmosApp) InterfaceRegistry

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

InterfaceRegistry returns SimApp's InterfaceRegistry

func (*DesmosApp) LegacyAmino

func (app *DesmosApp) 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 (*DesmosApp) LoadHeight

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

LoadHeight loads a particular height

func (*DesmosApp) ModuleAccountAddrs

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

ModuleAccountAddrs returns all the app's module account addresses.

func (*DesmosApp) Name

func (app *DesmosApp) Name() string

Name returns the name of the App

func (*DesmosApp) RegisterAPIRoutes

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

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

func (*DesmosApp) RegisterTendermintService

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

func (*DesmosApp) RegisterTxService

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

RegisterTxService implements the Application.RegisterTxService method.

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() GenesisState

NewDefaultGenesisState generates the default state for the application.

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	IBCkeeper         *ibckeeper.Keeper
	FeesKeeper        feeskeeper.Keeper
	TxCounterStoreKey sdk.StoreKey
	WasmConfig        wasmTypes.WasmConfig
}

HandlerOptions extend the SDK's AnteHandler options by requiring the IBC channel keeper.

Jump to

Keyboard shortcuts

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