Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ func NewWasmApp(
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
AllCapabilities(),
wasmkeeper.BuiltInCapabilities(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)
Expand Down
19 changes: 6 additions & 13 deletions app/wasm.go
Original file line number Diff line number Diff line change
@@ -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()

Check warning on line 9 in app/wasm.go

View check run for this annotation

Codecov / codecov/patch

app/wasm.go#L9

Added line #L9 was not covered by tests
}
20 changes: 20 additions & 0 deletions x/wasm/keeper/capabilities.go
Original file line number Diff line number Diff line change
@@ -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",
}
}