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

feat: QOL Capabilities functions #1316

Closed
wants to merge 1 commit into from
Closed
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
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