Add BuiltInCapabilities() to x/wasm/keeper and deprecate AllCapabilities() (#1855)

* Add BuiltInCapabilities() to x/wasm/keeper and deprecate AllCapabilities()

* Replace usage with new wasmkeeper.BuiltInCapabilities()
This commit is contained in:
Simon Warta
2024-04-12 15:36:26 +02:00
committed by GitHub
parent f77c07642d
commit cec66aeb79
3 changed files with 27 additions and 14 deletions

View File

@@ -642,7 +642,7 @@ func NewWasmApp(
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
AllCapabilities(),
wasmkeeper.BuiltInCapabilities(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)

View File

@@ -1,17 +1,10 @@
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
import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)
// Deprecated: Use BuiltInCapabilities from github.com/CosmWasm/wasmd/x/wasm/keeper
func AllCapabilities() []string {
return []string{
"iterator",
"staking",
"stargate",
"cosmwasm_1_1",
"cosmwasm_1_2",
"cosmwasm_1_3",
"cosmwasm_1_4",
"cosmwasm_2_0",
}
return wasmkeeper.BuiltInCapabilities()
}

View File

@@ -0,0 +1,20 @@
package keeper
// BuiltInCapabilities returns all capabilities currently supported by this version of x/wasm.
// See also https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md.
//
// Use this directly or together with your chain's custom capabilities (if any):
//
// append(wasmkeeper.BuiltInCapabilities(), "token_factory")
func BuiltInCapabilities() []string {
return []string{
"iterator",
"staking",
"stargate",
"cosmwasm_1_1",
"cosmwasm_1_2",
"cosmwasm_1_3",
"cosmwasm_1_4",
"cosmwasm_2_0",
}
}