Documentation ¶
Index ¶
- Constants
- Variables
- func GetEnabledProposals() []wasm.ProposalType
- func GetMaccPerms() map[string][]string
- func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string)
- func GetWasmOpts(appOpts servertypes.AppOptions, cdc codec.Codec, ...) []wasm.Option
- func MageWasmGasRegister() wasmkeeper.WasmGasRegisterConfig
- func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
- func MakeTestEncodingConfig() params.EncodingConfig
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func NewMageCustomMessageEncoder(cdc codec.Codec) wasm.MessageEncoders
- func NewMageCustomQueryPlugin(cdc codec.Codec, profilesKeeper profileskeeper.Keeper, ...) wasm.QueryPlugins
- func NewMageWasmGasRegister() wasmkeeper.WasmGasRegister
- func RegisterSwaggerAPI(rtr *mux.Router)
- func SetupConfig(config *sdk.Config)
- type GenesisState
- type HandlerOptions
- type MageApp
- func (app *MageApp) AppCodec() codec.Codec
- func (app *MageApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *MageApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *MageApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *MageApp) GetKey(storeKey string) *sdk.KVStoreKey
- func (app *MageApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
- func (app *MageApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *MageApp) GetTKey(storeKey string) *sdk.TransientStoreKey
- func (app *MageApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *MageApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *MageApp) LegacyAmino() *codec.LegacyAmino
- func (app *MageApp) LoadHeight(height int64) error
- func (app *MageApp) ModuleAccountAddrs() map[string]bool
- func (app *MageApp) Name() string
- func (app *MageApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *MageApp) RegisterNodeService(clientCtx client.Context)
- func (app *MageApp) RegisterTendermintService(clientCtx client.Context)
- func (app *MageApp) RegisterTxService(clientCtx client.Context)
- func (app *MageApp) SimulationManager() *module.SimulationManager
Constants ¶
const ( Bech32MainPrefix = "mage" CoinType = 852 FullFundraiserPath = "44'/852'/0'/0/0" )
const ( // DefaultMageInstanceCost is how much SDK gas we charge each time we load a WASM instance DefaultMageInstanceCost uint64 = 60_000 // DefaultMageCompileCost is how much SDK gas is charged *per byte* for compiling WASM code DefaultMageCompileCost uint64 = 2 )
Variables ¶
var ( ProposalsEnabled = "false" EnableSpecificProposals = "" )
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.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{}, feegrantmodule.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, ibctransfer.AppModuleBasic{}, authzmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, wasm.AppModuleBasic{}, profiles.AppModuleBasic{}, relationships.AppModuleBasic{}, subspaces.AppModuleBasic{}, posts.AppModuleBasic{}, reports.AppModuleBasic{}, reactions.AppModuleBasic{}, fees.AppModuleBasic{}, supply.AppModuleBasic{}, ) )
Functions ¶
func GetEnabledProposals ¶
func GetEnabledProposals() []wasm.ProposalType
GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to produce a list of enabled proposals to pass into mage app.
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 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 MageWasmGasRegister ¶
func MageWasmGasRegister() wasmkeeper.WasmGasRegisterConfig
MageWasmGasRegister is defaults plus a custom compile amount
func MakeCodecs ¶
func MakeCodecs() (codec.Codec, *codec.LegacyAmino)
MakeCodecs constructs the *std.Codec and *codec.LegacyAmino instances used by MageApp. It is useful for tests and clients who do not want to construct the full MageApp
func MakeTestEncodingConfig ¶
func MakeTestEncodingConfig() params.EncodingConfig
MakeTestEncodingConfig creates an EncodingConfig for testing
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
func NewMageCustomMessageEncoder ¶
func NewMageCustomMessageEncoder(cdc codec.Codec) wasm.MessageEncoders
NewMageCustomMessageEncoder initialize the custom message encoder to mage app for contracts
func NewMageCustomQueryPlugin ¶
func NewMageCustomQueryPlugin( cdc codec.Codec, profilesKeeper profileskeeper.Keeper, subspacesKeeper subspaceskeeper.Keeper, relationshipsKeeper relationshipskeeper.Keeper, postsKeeper postskeeper.Keeper, reportsKeeper reportskeeper.Keeper, reactionsKeeper reactionskeeper.Keeper, ) wasm.QueryPlugins
NewMageCustomQueryPlugin initialize the custom querier to handle mage queries for contracts
func NewMageWasmGasRegister ¶
func NewMageWasmGasRegister() wasmkeeper.WasmGasRegister
func RegisterSwaggerAPI ¶
RegisterSwaggerAPI registers swagger route with API Server
func SetupConfig ¶
SetupConfig sets up the given config as it should be for Mage
Types ¶
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.
type MageApp ¶
type MageApp 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 }
MageApp 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 NewMageApp ¶
func NewMageApp( 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), ) *MageApp
NewMageApp is a constructor function for MageApp
func (*MageApp) AppCodec ¶
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 (*MageApp) BeginBlocker ¶
func (app *MageApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlocker application updates every begin block
func (*MageApp) EndBlocker ¶
func (app *MageApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*MageApp) ExportAppStateAndValidators ¶
func (app *MageApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*MageApp) GetKey ¶
func (app *MageApp) 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 (*MageApp) GetMemKey ¶
func (app *MageApp) GetMemKey(storeKey string) *sdk.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*MageApp) GetSubspace ¶
func (app *MageApp) 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 (*MageApp) GetTKey ¶
func (app *MageApp) 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 (*MageApp) InitChainer ¶
func (app *MageApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update.md at chain initialization
func (*MageApp) InterfaceRegistry ¶
func (app *MageApp) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns SimApp's InterfaceRegistry
func (*MageApp) LegacyAmino ¶
func (app *MageApp) 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 (*MageApp) LoadHeight ¶
LoadHeight loads a particular height
func (*MageApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*MageApp) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*MageApp) RegisterNodeService ¶
func (*MageApp) RegisterTendermintService ¶
func (*MageApp) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (*MageApp) SimulationManager ¶
func (app *MageApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface