Documentation ¶
Index ¶
- Constants
- Variables
- func GetEnabledProposals() []wasm.ProposalType
- func GetMaccPerms() map[string][]string
- func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router)
- type EmptyAppOptions
- type EncodingConfig
- type GenesisState
- type TestSupport
- func (s TestSupport) AppCodec() codec.Marshaler
- func (s TestSupport) BankKeeper() bankkeeper.Keeper
- func (s TestSupport) IBCKeeper() ibckeeper.Keeper
- func (s TestSupport) StakingKeeper() stakingkeeper.Keeper
- func (s TestSupport) TransferKeeper() ibctransferkeeper.Keeper
- func (s TestSupport) WasmKeeper() wasm.Keeper
- type WasmApp
- func (app *WasmApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (app *WasmApp) BlockedAddrs() map[string]bool
- func (app *WasmApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
- func (app *WasmApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string) (servertypes.ExportedApp, error)
- func (app *WasmApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
- func (app *WasmApp) LegacyAmino() *codec.LegacyAmino
- func (app *WasmApp) LoadHeight(height int64) error
- func (app *WasmApp) ModuleAccountAddrs() map[string]bool
- func (app *WasmApp) Name() string
- func (app *WasmApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *WasmApp) RegisterTxService(clientCtx client.Context)
- func (app *WasmApp) SimulationManager() *module.SimulationManager
Constants ¶
const ( StakePerAccount = "stake_per_account" InitiallyBondedValidators = "initially_bonded_validators" OpWeightDeductFee = "op_weight_deduct_fee" OpWeightMsgSend = "op_weight_msg_send" OpWeightMsgMultiSend = "op_weight_msg_multisend" OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" OpWeightSubmitTextProposal = "op_weight_submit_text_proposal" OpWeightSubmitCommunitySpendProposal = "op_weight_submit_community_spend_proposal" OpWeightSubmitParamChangeProposal = "op_weight_submit_param_change_proposal" OpWeightMsgDeposit = "op_weight_msg_deposit" OpWeightMsgVote = "op_weight_msg_vote" OpWeightMsgCreateValidator = "op_weight_msg_create_validator" OpWeightMsgEditValidator = "op_weight_msg_edit_validator" OpWeightMsgDelegate = "op_weight_msg_delegate" OpWeightMsgUndelegate = "op_weight_msg_undelegate" OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" OpWeightMsgUnjail = "op_weight_msg_unjail" )
Simulation parameter constants
Variables ¶
var ( NodeDir = ".wasmd" Bech32Prefix = "wasm" // 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 = "false" // 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/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" )
We pull these out so we can set them with LDFLAGS in the Makefile
var ( // DefaultNodeHome default home directories for wasmd DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir // 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 ( // 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)..., ), params.AppModuleBasic{}, wasm.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, ) )
Functions ¶
func GetEnabledProposals ¶ added in v0.10.0
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
Types ¶
type EmptyAppOptions ¶ added in v0.12.0
type EmptyAppOptions struct{}
EmptyAppOptions is a stub implementing AppOptions
func (EmptyAppOptions) Get ¶ added in v0.12.0
func (ao EmptyAppOptions) Get(o string) interface{}
Get implements AppOptions
type EncodingConfig ¶ added in v0.12.0
type EncodingConfig struct { InterfaceRegistry types.InterfaceRegistry Marshaler codec.Marshaler TxConfig client.TxConfig Amino *codec.LegacyAmino }
EncodingConfig specifies the concrete encoding types to use for a given app. This is provided for compatibility between protobuf and amino implementations.
func MakeEncodingConfig ¶ added in v0.12.0
func MakeEncodingConfig() EncodingConfig
type GenesisState ¶
type GenesisState map[string]json.RawMessage
The genesis state 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 NewDefaultGenesisState ¶
func NewDefaultGenesisState() GenesisState
NewDefaultGenesisState generates the default state for the application.
type TestSupport ¶ added in v0.12.0
type TestSupport struct {
// contains filtered or unexported fields
}
func NewTestSupport ¶ added in v0.12.0
func NewTestSupport(t *testing.T, app *WasmApp) *TestSupport
func (TestSupport) AppCodec ¶ added in v0.12.0
func (s TestSupport) AppCodec() codec.Marshaler
func (TestSupport) BankKeeper ¶ added in v0.12.0
func (s TestSupport) BankKeeper() bankkeeper.Keeper
func (TestSupport) IBCKeeper ¶ added in v0.12.0
func (s TestSupport) IBCKeeper() ibckeeper.Keeper
func (TestSupport) StakingKeeper ¶ added in v0.12.0
func (s TestSupport) StakingKeeper() stakingkeeper.Keeper
func (TestSupport) TransferKeeper ¶ added in v0.12.0
func (s TestSupport) TransferKeeper() ibctransferkeeper.Keeper
func (TestSupport) WasmKeeper ¶ added in v0.12.0
func (s TestSupport) WasmKeeper() wasm.Keeper
type WasmApp ¶
type WasmApp struct { *baseapp.BaseApp // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper // contains filtered or unexported fields }
WasmApp extended ABCI application
func NewWasmApp ¶
func NewWasmApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, enabledProposals []wasm.ProposalType, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp)) *WasmApp
NewWasmApp returns a reference to an initialized WasmApp.
func (*WasmApp) BeginBlocker ¶
func (app *WasmApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
application updates every begin block
func (*WasmApp) BlockedAddrs ¶ added in v0.12.0
BlockedAddrs returns all the app's module account addresses that are not allowed to receive external tokens.
func (*WasmApp) EndBlocker ¶
func (app *WasmApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
EndBlocker application updates every end block
func (*WasmApp) ExportAppStateAndValidators ¶
func (app *WasmApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*WasmApp) InitChainer ¶
func (app *WasmApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
InitChainer application update at chain initialization
func (*WasmApp) LegacyAmino ¶ added in v0.12.0
func (app *WasmApp) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns the application's sealed codec.
func (*WasmApp) LoadHeight ¶
LoadHeight loads a particular height
func (*WasmApp) ModuleAccountAddrs ¶
ModuleAccountAddrs returns all the app's module account addresses.
func (*WasmApp) RegisterAPIRoutes ¶ added in v0.12.0
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*WasmApp) RegisterTxService ¶ added in v0.12.0
RegisterTxService implements the Application.RegisterTxService method.
func (*WasmApp) SimulationManager ¶
func (app *WasmApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface