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:
@@ -642,7 +642,7 @@ func NewWasmApp(
|
||||
app.GRPCQueryRouter(),
|
||||
wasmDir,
|
||||
wasmConfig,
|
||||
AllCapabilities(),
|
||||
wasmkeeper.BuiltInCapabilities(),
|
||||
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
|
||||
wasmOpts...,
|
||||
)
|
||||
|
||||
19
app/wasm.go
19
app/wasm.go
@@ -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()
|
||||
}
|
||||
|
||||
20
x/wasm/keeper/capabilities.go
Normal file
20
x/wasm/keeper/capabilities.go
Normal 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",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user