Skip to content
Open
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/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func TestAppStateDeterminism(t *testing.T) {

appOptions := viper.New()
if FlagEnableStreamingValue {
m := make(map[string]interface{})
m := make(map[string]any)
m["streaming.abci.keys"] = []string{"*"}
m["streaming.abci.plugin"] = "abci_v1"
m["streaming.abci.stop-node-on-err"] = true
Expand Down
2 changes: 1 addition & 1 deletion cmd/wasmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func initCometBFTConfig() *cmtcfg.Config {

// initAppConfig helps to override default appConfig template and configs.
// return "", nil if no custom configuration is required for the application.
func initAppConfig() (string, interface{}) {
func initAppConfig() (string, any) {
// The following code snippet is just for reference.

type CustomAppConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ func must[t any](s t, err error) t {
return s
}

func mustUnmarshal(t *testing.T, data []byte, res interface{}) {
func mustUnmarshal(t *testing.T, data []byte, res any) {
t.Helper()
err := json.Unmarshal(data, res)
require.NoError(t, err)
}

func mustMarshal(t *testing.T, r interface{}) []byte {
func mustMarshal(t *testing.T, r any) []byte {
t.Helper()
bz, err := json.Marshal(r)
require.NoError(t, err)
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func TestHandleExecuteEscrow(t *testing.T) {
require.NoError(t, err)

bob := keyPubAddr()
initMsg := map[string]interface{}{
initMsg := map[string]any{
"verifier": fred.String(),
"beneficiary": bob.String(),
}
Expand All @@ -429,8 +429,8 @@ func TestHandleExecuteEscrow(t *testing.T) {
contractBech32Addr := parseInitResponse(t, res.Data)
require.Equal(t, "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr", contractBech32Addr)

handleMsg := map[string]interface{}{
"release": map[string]interface{}{},
handleMsg := map[string]any{
"release": map[string]any{},
}
handleMsgBz, err := json.Marshal(handleMsg)
require.NoError(t, err)
Expand Down Expand Up @@ -533,9 +533,9 @@ func TestReadNodeConfig(t *testing.T) {
}
}

type AppOptionsMock map[string]interface{}
type AppOptionsMock map[string]any

func (a AppOptionsMock) Get(s string) interface{} {
func (a AppOptionsMock) Get(s string) any {
return a[s]
}

Expand Down
2 changes: 1 addition & 1 deletion tests/wasmibctesting/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (chain *WasmTestChain) SendNonDefaultSenderMsgs(senderPrivKey cryptotypes.P
// SmartQuery This will serialize the query message and submit it to the contract.
// The response is parsed into the provided interface.
// Usage: SmartQuery(addr, QueryMsg{Foo: 1}, &response)
func (chain *WasmTestChain) SmartQuery(contractAddr string, queryMsg, response interface{}) error {
func (chain *WasmTestChain) SmartQuery(contractAddr string, queryMsg, response any) error {
msg, err := json.Marshal(queryMsg)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestLimitSimulationGasDecorator(t *testing.T) {
consumeGas storetypes.Gas
maxBlockGas int64
simulation bool
expErr interface{}
expErr any
}{
"custom limit set": {
customLimit: &hundred,
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/handler_plugin_encoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func EncodeGovMsg(sender sdk.AccAddress, msg *wasmvmtypes.GovMsg) ([]sdk.Msg, er
}
}

func convertVoteOption(s interface{}) (v1.VoteOption, error) {
func convertVoteOption(s any) (v1.VoteOption, error) {
var option v1.VoteOption
switch s {
case wasmvmtypes.Yes:
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ func TestMigrateWithDispatchedMessage(t *testing.T) {
ctx = ctx.WithEventManager(sdk.NewEventManager()).WithBlockHeight(ctx.BlockHeight() + 1)
_, err = keeper.Migrate(ctx, contractAddr, fred, burnerContractID, migMsgBz)
require.NoError(t, err)
type dict map[string]interface{}
type dict map[string]any
expEvents := []dict{
{
"Type": "migrate",
Expand Down Expand Up @@ -1746,7 +1746,7 @@ func prettyEvents(t *testing.T, events sdk.Events) string {
return string(mustMarshal(t, r))
}

func mustMarshal(t *testing.T, r interface{}) []byte {
func mustMarshal(t *testing.T, r any) []byte {
t.Helper()
bz, err := json.Marshal(r)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
ReflectCapabilities = []string{"staking", "mask", "stargate", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"}
)

func mustUnmarshal(t *testing.T, data []byte, res interface{}) {
func mustUnmarshal(t *testing.T, data []byte, res any) {
t.Helper()
err := json.Unmarshal(data, res)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/test_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm/types"
)

var ModelFuzzers = []interface{}{FuzzAddr, FuzzAddrString, FuzzAbsoluteTxPosition, FuzzContractInfo, FuzzStateModel, FuzzAccessType, FuzzAccessConfig, FuzzContractCodeHistory}
var ModelFuzzers = []any{FuzzAddr, FuzzAddrString, FuzzAbsoluteTxPosition, FuzzContractInfo, FuzzStateModel, FuzzAccessType, FuzzAccessConfig, FuzzContractCodeHistory}

func FuzzAddr(m *sdk.AccAddress, c fuzz.Continue) {
*m = make([]byte, 20)
Expand Down
8 changes: 4 additions & 4 deletions x/wasm/migrations/v2/legacy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ var fileDescriptor_e6155d98fa173e02 = []byte{
0x00,
}

func (m *AccessTypeParam) Equal(that interface{}) bool {
func (m *AccessTypeParam) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand All @@ -341,7 +341,7 @@ func (m *AccessTypeParam) Equal(that interface{}) bool {
return true
}

func (m *AccessConfig) Equal(that interface{}) bool {
func (m *AccessConfig) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down Expand Up @@ -377,7 +377,7 @@ func (m *AccessConfig) Equal(that interface{}) bool {
return true
}

func (m *Params) Equal(that interface{}) bool {
func (m *Params) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down Expand Up @@ -405,7 +405,7 @@ func (m *Params) Equal(that interface{}) bool {
return true
}

func (m *CodeInfo) Equal(that interface{}) bool {
func (m *CodeInfo) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/migrations/v2/params_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
}
}

func validateAccessConfig(i interface{}) error {
func validateAccessConfig(i any) error {
v, ok := i.(AccessConfig)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
Expand All @@ -53,7 +53,7 @@ var AllAccessTypes = []AccessType{
AccessTypeEverybody,
}

func validateAccessType(i interface{}) error {
func validateAccessType(i any) error {
a, ok := i.(AccessType)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
Expand Down
8 changes: 4 additions & 4 deletions x/wasm/migrations/v3/legacy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ var fileDescriptor_e6155d98fa173e02 = []byte{
0x00,
}

func (m *AccessTypeParam) Equal(that interface{}) bool {
func (m *AccessTypeParam) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand All @@ -342,7 +342,7 @@ func (m *AccessTypeParam) Equal(that interface{}) bool {
return true
}

func (m *AccessConfig) Equal(that interface{}) bool {
func (m *AccessConfig) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down Expand Up @@ -370,7 +370,7 @@ func (m *AccessConfig) Equal(that interface{}) bool {
return slices.Equal(m.Addresses, that1.Addresses)
}

func (m *Params) Equal(that interface{}) bool {
func (m *Params) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down Expand Up @@ -398,7 +398,7 @@ func (m *Params) Equal(that interface{}) bool {
return true
}

func (m *CodeInfo) Equal(that interface{}) bool {
func (m *CodeInfo) Equal(that any) bool {
if that == nil {
return m == nil
}
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (e WasmVMFlavouredError) Wrap(desc string) error { return errorsmod.Wrap(e,

// Wrapf extends this error with additional information.
// It's a handy function to call Wrapf with sdk errors.
func (e WasmVMFlavouredError) Wrapf(desc string, args ...interface{}) error {
func (e WasmVMFlavouredError) Wrapf(desc string, args ...any) error {
return errorsmod.Wrapf(e, desc, args...)
}

Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/json_matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func isJSONObjectWithTopLevelKey(jsonBytes RawContractMessage, allowedKeys []str
return false, err
}

document := map[string]interface{}{}
document := map[string]any{}
if err := json.Unmarshal(jsonBytes, &document); err != nil {
return false, nil // not a map
}
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/json_matching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestIsJSONObjectWithTopLevelKey(t *testing.T) {
func TestDuplicateKeyGivesSameResult(t *testing.T) {
jsonBytes := []byte(`{"event⑨thing": "foo", "event⑨thing":"bar"}`)
for i := 0; i < 10000; i++ {
document := map[string]interface{}{}
document := map[string]any{}
require.NoError(t, json.Unmarshal(jsonBytes, &document))
assert.Equal(t, "bar", document["event⑨thing"])
}
Expand Down
14 changes: 7 additions & 7 deletions x/wasm/types/proposal_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (p StoreCodeProposal) String() string {
}

// MarshalYAML pretty prints the wasm byte code
func (p StoreCodeProposal) MarshalYAML() (interface{}, error) {
func (p StoreCodeProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -202,7 +202,7 @@ func (p InstantiateContractProposal) String() string {
}

// MarshalYAML pretty prints the init message
func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) {
func (p InstantiateContractProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -293,7 +293,7 @@ func (p InstantiateContract2Proposal) String() string {
}

// MarshalYAML pretty prints the init message
func (p InstantiateContract2Proposal) MarshalYAML() (interface{}, error) {
func (p InstantiateContract2Proposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -393,7 +393,7 @@ func (p StoreAndInstantiateContractProposal) String() string {
}

// MarshalYAML pretty prints the wasm byte code and the init message
func (p StoreAndInstantiateContractProposal) MarshalYAML() (interface{}, error) {
func (p StoreAndInstantiateContractProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -466,7 +466,7 @@ func (p MigrateContractProposal) String() string {
}

// MarshalYAML pretty prints the migrate message
func (p MigrateContractProposal) MarshalYAML() (interface{}, error) {
func (p MigrateContractProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -519,7 +519,7 @@ func (p SudoContractProposal) String() string {
}

// MarshalYAML pretty prints the migrate message
func (p SudoContractProposal) MarshalYAML() (interface{}, error) {
func (p SudoContractProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down Expand Up @@ -578,7 +578,7 @@ func (p ExecuteContractProposal) String() string {
}

// MarshalYAML pretty prints the migrate message
func (p ExecuteContractProposal) MarshalYAML() (interface{}, error) {
func (p ExecuteContractProposal) MarshalYAML() (any, error) {
return struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
Expand Down
Loading