Extract configured capabilities

This commit is contained in:
Alex Peters
2023-04-24 11:46:03 +02:00
parent b85abcf1d7
commit 6f35724070
2 changed files with 15 additions and 2 deletions

View File

@@ -583,8 +583,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 := strings.Join(AllCapabilities(), ",")
app.WasmKeeper = wasm.NewKeeper(
appCodec,
keys[wasm.StoreKey],

14
app/wasm.go Normal file
View File

@@ -0,0 +1,14 @@
package app
// AllCapabilities returns all capabilities available with the current wasmvm
// See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md
// This functionality is going to be moved upstream: https://github.com/CosmWasm/wasmvm/issues/425
func AllCapabilities() []string {
return []string{
"iterator",
"staking",
"stargate",
"cosmwasm_1_1",
"cosmwasm_1_2",
}
}