@@ -63,7 +63,7 @@ jobs:
|
||||
|
||||
lint:
|
||||
docker:
|
||||
- image: golangci/golangci-lint:v1.52.2
|
||||
- image: golangci/golangci-lint:v1.54.2
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
|
||||
@@ -5,11 +5,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,14 +4,13 @@ import (
|
||||
"encoding/hex"
|
||||
"testing"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/ioutils"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func InitGenesis(ctx sdk.Context, keeper *Keeper, data types.GenesisState) ([]ab
|
||||
if err != nil {
|
||||
return nil, errorsmod.Wrapf(err, "address in contract number %d", i)
|
||||
}
|
||||
err = keeper.importContract(ctx, contractAddr, &contract.ContractInfo, contract.ContractState, contract.ContractCodeHistory)
|
||||
err = keeper.importContract(ctx, contractAddr, &contract.ContractInfo, contract.ContractState, contract.ContractCodeHistory) //nolint:gosec
|
||||
if err != nil {
|
||||
return nil, errorsmod.Wrapf(err, "contract number %d", i)
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ func TestIBCRawPacketHandler(t *testing.T) {
|
||||
capturedPacket = nil
|
||||
// when
|
||||
h := NewIBCRawPacketHandler(capturePacketsSenderMock, spec.chanKeeper, spec.capKeeper)
|
||||
evts, data, gotErr := h.DispatchMsg(ctx, RandomAccountAddress(t), ibcPort, wasmvmtypes.CosmosMsg{IBC: &wasmvmtypes.IBCMsg{SendPacket: &spec.srcMsg}})
|
||||
evts, data, gotErr := h.DispatchMsg(ctx, RandomAccountAddress(t), ibcPort, wasmvmtypes.CosmosMsg{IBC: &wasmvmtypes.IBCMsg{SendPacket: &spec.srcMsg}}) //nolint:gosec
|
||||
// then
|
||||
require.True(t, spec.expErr.Is(gotErr), "exp %v but got %#+v", spec.expErr, gotErr)
|
||||
if spec.expErr != nil {
|
||||
@@ -390,7 +390,7 @@ func TestBurnCoinMessageHandlerIntegration(t *testing.T) {
|
||||
k.wasmVM = &wasmtesting.MockWasmEngine{ExecuteFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) {
|
||||
return &wasmvmtypes.Response{
|
||||
Messages: []wasmvmtypes.SubMsg{
|
||||
{Msg: wasmvmtypes.CosmosMsg{Bank: &wasmvmtypes.BankMsg{Burn: &spec.msg}}, ReplyOn: wasmvmtypes.ReplyNever},
|
||||
{Msg: wasmvmtypes.CosmosMsg{Bank: &wasmvmtypes.BankMsg{Burn: &spec.msg}}, ReplyOn: wasmvmtypes.ReplyNever}, //nolint:gosec
|
||||
},
|
||||
}, 0, nil
|
||||
}}
|
||||
|
||||
@@ -11,8 +11,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
|
||||
wasmvm "github.com/CosmWasm/wasmvm"
|
||||
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
@@ -36,6 +34,7 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
)
|
||||
@@ -549,7 +548,7 @@ func TestInstantiateWithPermissions(t *testing.T) {
|
||||
accKeeper, bankKeeper, keeper := keepers.AccountKeeper, keepers.BankKeeper, keepers.ContractKeeper
|
||||
fundAccounts(t, ctx, accKeeper, bankKeeper, spec.srcActor, deposit)
|
||||
|
||||
contractID, _, err := keeper.Create(ctx, myAddr, hackatomWasm, &spec.srcPermission)
|
||||
contractID, _, err := keeper.Create(ctx, myAddr, hackatomWasm, &spec.srcPermission) //nolint:gosec
|
||||
require.NoError(t, err)
|
||||
|
||||
_, _, err = keepers.ContractKeeper.Instantiate(ctx, contractID, spec.srcActor, nil, initMsgBz, "demo contract 1", nil)
|
||||
|
||||
@@ -132,7 +132,7 @@ func TestUpdateParams(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// when
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src)
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src) //nolint:gosec
|
||||
require.NoError(t, err)
|
||||
var result types.MsgUpdateParamsResponse
|
||||
require.NoError(t, wasmApp.AppCodec().Unmarshal(rsp.Data, &result))
|
||||
@@ -223,7 +223,7 @@ func TestAddCodeUploadParamsAddresses(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// when
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src)
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src) //nolint:gosec
|
||||
if spec.expErr {
|
||||
require.Error(t, err)
|
||||
require.Nil(t, rsp)
|
||||
@@ -319,7 +319,7 @@ func TestRemoveCodeUploadParamsAddresses(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// when
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src)
|
||||
rsp, err := wasmApp.MsgServiceRouter().Handler(&spec.src)(ctx, &spec.src) //nolint:gosec
|
||||
if spec.expErr {
|
||||
require.Error(t, err)
|
||||
require.Nil(t, rsp)
|
||||
|
||||
@@ -4,9 +4,8 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
||||
wasmvm "github.com/CosmWasm/wasmvm"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
|
||||
wasmvm "github.com/CosmWasm/wasmvm"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -20,6 +18,7 @@ import (
|
||||
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
)
|
||||
@@ -639,7 +638,7 @@ func TestAdminProposals(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
require.NoError(t, wasmKeeper.importContract(ctx, contractAddr, &spec.state, []types.Model{}, entries))
|
||||
require.NoError(t, wasmKeeper.importContract(ctx, contractAddr, &spec.state, []types.Model{}, entries)) //nolint:gosec
|
||||
|
||||
// when
|
||||
mustSubmitAndExecuteLegacyProposal(t, ctx, spec.srcProposal, otherAddress.String(), keepers)
|
||||
|
||||
@@ -522,7 +522,7 @@ func TestQueryContractHistory(t *testing.T) {
|
||||
|
||||
// when
|
||||
q := Querier(keeper)
|
||||
got, err := q.ContractHistory(sdk.WrapSDKContext(xCtx), &spec.req)
|
||||
got, err := q.ContractHistory(sdk.WrapSDKContext(xCtx), &spec.req) //nolint:gosec
|
||||
|
||||
// then
|
||||
if spec.expContent == nil {
|
||||
@@ -597,7 +597,7 @@ func TestQueryCodeList(t *testing.T) {
|
||||
}
|
||||
// when
|
||||
q := Querier(keeper)
|
||||
got, err := q.Codes(sdk.WrapSDKContext(xCtx), &spec.req)
|
||||
got, err := q.Codes(sdk.WrapSDKContext(xCtx), &spec.req) //nolint:gosec
|
||||
|
||||
// then
|
||||
require.NoError(t, err)
|
||||
@@ -664,7 +664,7 @@ func TestQueryContractInfo(t *testing.T) {
|
||||
for name, spec := range specs {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
xCtx, _ := ctx.CacheContext()
|
||||
k.storeContractInfo(xCtx, contractAddr, &spec.stored)
|
||||
k.storeContractInfo(xCtx, contractAddr, &spec.stored) //nolint:gosec
|
||||
// when
|
||||
gotRsp, gotErr := querier.ContractInfo(sdk.WrapSDKContext(xCtx), spec.src)
|
||||
if spec.expErr {
|
||||
|
||||
@@ -7,18 +7,18 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
|
||||
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
)
|
||||
@@ -506,7 +506,7 @@ func TestDistributionQuery(t *testing.T) {
|
||||
},
|
||||
"delegator address - withdrawal addr set": {
|
||||
setup: func(t *testing.T, ctx sdk.Context) sdk.Context {
|
||||
keepers.DistKeeper.SetWithdrawAddr(ctx, delegator, otherAddr)
|
||||
require.NoError(t, keepers.DistKeeper.SetWithdrawAddr(ctx, delegator, otherAddr))
|
||||
return ctx
|
||||
},
|
||||
query: &wasmvmtypes.DistributionQuery{
|
||||
|
||||
@@ -9,14 +9,19 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
|
||||
dbm "github.com/cometbft/cometbft-db"
|
||||
"github.com/cometbft/cometbft/libs/log"
|
||||
"github.com/cometbft/cometbft/libs/rand"
|
||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
sdkmath "cosmossdk.io/math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
|
||||
@@ -27,10 +32,6 @@ import (
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/CosmWasm/wasmd/app"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper"
|
||||
@@ -809,7 +810,7 @@ func TestDistributionQuerier(t *testing.T) {
|
||||
var mock types.DistributionKeeper
|
||||
q := keeper.DistributionQuerier(mock)
|
||||
|
||||
gotBz, gotErr := q(ctx, &spec.q)
|
||||
gotBz, gotErr := q(ctx, &spec.q) //nolint:gosec
|
||||
if spec.expErr {
|
||||
require.Error(t, gotErr)
|
||||
return
|
||||
|
||||
@@ -5,9 +5,12 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
|
||||
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@@ -15,8 +18,6 @@ import (
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
|
||||
"github.com/CosmWasm/wasmd/x/wasm/types"
|
||||
|
||||
@@ -992,7 +992,7 @@ code_ids:
|
||||
}
|
||||
for msg, spec := range specs {
|
||||
t.Run(msg, func(t *testing.T) {
|
||||
v, err := yaml.Marshal(&spec.src)
|
||||
v, err := yaml.Marshal(&spec.src) //nolint:gosec
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, spec.exp, string(v))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user