Skip to content

Commit

Permalink
Rename some more "features" to "capabilities" (#1679)
Browse files Browse the repository at this point in the history
* Format code

* Rename {Reflect,Cyberpunk}Features -> {Reflect,Cyberpunk}Capabilities
  • Loading branch information
webmaster128 authored Oct 20, 2023
1 parent 606289a commit a6fe36d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion tests/system/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ func (c WasmdCli) IsInCometBftValset(valPubKey cryptotypes.PubKey) (cmtservice.G
return valResult, found
}


// SubmitGovProposal submit a gov v1 proposal
func (c WasmdCli) SubmitGovProposal(proposalJson string, args ...string) string {
if len(args) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/addresses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package keeper
import (
"encoding/json"
"fmt"
tmbytes "github.com/cometbft/cometbft/libs/bytes"
"testing"

tmbytes "github.com/cometbft/cometbft/libs/bytes"
"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
18 changes: 9 additions & 9 deletions x/wasm/keeper/query_plugin_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

func TestMaskReflectCustomQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestMaskReflectCustomQuery(t *testing.T) {

func TestReflectStargateQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

funds := sdk.NewCoins(sdk.NewInt64Coin("denom", 320000))
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestReflectStargateQuery(t *testing.T) {

func TestReflectTotalSupplyQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
// upload code
codeID := StoreReflectContract(t, ctx, keepers).CodeID
Expand Down Expand Up @@ -169,7 +169,7 @@ func TestReflectTotalSupplyQuery(t *testing.T) {

func TestReflectInvalidStargateQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

funds := sdk.NewCoins(sdk.NewInt64Coin("denom", 320000))
Expand Down Expand Up @@ -250,7 +250,7 @@ type reflectState struct {

func TestMaskReflectWasmQueries(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestMaskReflectWasmQueries(t *testing.T) {

func TestWasmRawQueryWithNil(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -363,7 +363,7 @@ func TestWasmRawQueryWithNil(t *testing.T) {
}

func TestQueryDenomsIntegration(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, CyberpunkFeatures)
ctx, keepers := CreateTestInput(t, false, CyberpunkCapabilities)
ck, k := keepers.ContractKeeper, keepers.WasmKeeper
creator := keepers.Faucet.NewFundedRandomAccount(ctx, sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))...)

Expand Down Expand Up @@ -477,7 +477,7 @@ func TestQueryDenomsIntegration(t *testing.T) {

func TestDistributionQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
pCtx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
pCtx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper

example := InstantiateReflectExampleContract(t, pCtx, keepers)
Expand Down Expand Up @@ -646,7 +646,7 @@ func TestDistributionQuery(t *testing.T) {

func TestIBCListChannelsQuery(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
pCtx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
pCtx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
nonIbcExample := InstantiateReflectExampleContract(t, pCtx, keepers)
ibcExample := InstantiateReflectExampleContract(t, pCtx, keepers)
Expand Down
10 changes: 5 additions & 5 deletions x/wasm/keeper/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

const (
CyberpunkFeatures = "staking,mask,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4"
ReflectFeatures = CyberpunkFeatures
CyberpunkCapabilities = "staking,mask,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4"
ReflectCapabilities = CyberpunkCapabilities
)

func mustUnmarshal(t *testing.T, data []byte, res interface{}) {
Expand All @@ -36,7 +36,7 @@ func mustUnmarshal(t *testing.T, data []byte, res interface{}) {

func TestReflectContractSend(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)))
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestReflectContractSend(t *testing.T) {

func TestReflectCustomMsg(t *testing.T) {
cdc := MakeEncodingConfig(t).Codec
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestReflectCustomMsg(t *testing.T) {
}

func TestRustPanicIsHandled(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, CyberpunkFeatures)
ctx, keepers := CreateTestInput(t, false, CyberpunkCapabilities)
keeper := keepers.ContractKeeper

creator := keepers.Faucet.NewFundedRandomAccount(ctx, sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))...)
Expand Down
8 changes: 4 additions & 4 deletions x/wasm/keeper/submsg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

// Try a simple send, no gas limit to for a sanity check before trying table tests
func TestDispatchSubMsgSuccessCase(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, ReflectFeatures)
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities)
accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.WasmKeeper, keepers.BankKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
subGasLimit := uint64(300_000)

// prep - create one chain and upload the code
ctx, keepers := CreateTestInput(t, false, ReflectFeatures)
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities)
ctx = ctx.WithGasMeter(storetypes.NewInfiniteGasMeter())
ctx = ctx.WithBlockGasMeter(storetypes.NewInfiniteGasMeter())
keeper := keepers.WasmKeeper
Expand Down Expand Up @@ -367,7 +367,7 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) {
Bank: nilEncoder,
}

ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageHandler(NewSDKMessageHandler(MakeTestCodec(t), nil, customEncoders)))
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities, WithMessageHandler(NewSDKMessageHandler(MakeTestCodec(t), nil, customEncoders)))
keeper := keepers.WasmKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down Expand Up @@ -433,7 +433,7 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) {

// Try a simple send, no gas limit to for a sanity check before trying table tests
func TestDispatchSubMsgConditionalReplyOn(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, ReflectFeatures)
ctx, keepers := CreateTestInput(t, false, ReflectCapabilities)
keeper := keepers.WasmKeeper

deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
Expand Down

0 comments on commit a6fe36d

Please sign in to comment.