Skip to content

Commit

Permalink
Add capability functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Apr 3, 2023
1 parent b33c38c commit c24c67a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit c24c67a

Please sign in to comment.