From c24c67a70d17561f8bf35120b9932168ccf8e586 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 3 Apr 2023 18:13:27 -0500 Subject: [PATCH] Add capability functions --- app/app.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 758fe607cf..77fb51cdbd 100644 --- a/app/app.go +++ b/app/app.go @@ -161,6 +161,16 @@ func GetEnabledProposals() []wasm.ProposalType { return proposals } +// GetDefaultCosmosCapabilities returns the default capabilities for a cosmos-sdk based chain. +func GetDefaultCosmosCapabilities() string { + return "iterator,staking,stargate" +} + +// GetDefaultWasmCapabilities returns the default capabilities for a cosmwasm based chain. +func GetDefaultWasmCapabilities() string { + return "cosmwasm_1_1,cosmwasm_1_2" +} + // 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 @@ -584,7 +594,7 @@ func NewWasmApp( // The last arguments can contain custom message handlers, and custom query handlers, // if we want to allow any custom callbacks // See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md - availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2" + availableCapabilities := fmt.Sprintf("%s,%s", GetDefaultCosmosCapabilities(), GetDefaultWasmCapabilities()) app.WasmKeeper = wasm.NewKeeper( appCodec, keys[wasm.StoreKey],