Skip to content

Commit 9404e32

Browse files
committed
testifylint execpt for the MockInfoBin
1 parent 6480176 commit 9404e32

13 files changed

+111
-105
lines changed

.golangci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
run:
2+
tests: true
3+
14
linters:
25
# Enable specific linter
36
# https://golangci-lint.run/usage/linters/#enabled-by-default
47
enable:
58
- gofumpt
6-
- goimports
9+
- gci
10+
- testifylint
711

8-
linters-settings:
9-
goimports:
10-
local-prefixes: github.com/CosmWasm/wasmvm
12+
issues:
13+
max-issues-per-linter: 0
14+
max-same-issues: 0

ibc_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestIBCHandshake(t *testing.T) {
132132
require.NoError(t, err)
133133
require.NotNil(t, conn.Ok)
134134
connResponse := conn.Ok
135-
require.Equal(t, 1, len(connResponse.Messages))
135+
require.Len(t, connResponse.Messages, 1)
136136

137137
// check for the expected custom event
138138
expected_events := []types.Event{{
@@ -237,7 +237,7 @@ func TestIBCPacketDispatch(t *testing.T) {
237237
var accounts ListAccountsResponse
238238
err = json.Unmarshal(qResponse, &accounts)
239239
require.NoError(t, err)
240-
require.Equal(t, 1, len(accounts.Accounts))
240+
require.Len(t, accounts.Accounts, 1)
241241
require.Equal(t, CHANNEL_ID, accounts.Accounts[0].ChannelID)
242242
require.Equal(t, REFLECT_ADDR, accounts.Accounts[0].Account)
243243

@@ -332,7 +332,7 @@ func TestIBCMsgGetChannel(t *testing.T) {
332332
require.Equal(t, msg1.GetChannel(), msg4.GetChannel())
333333
require.Equal(t, msg1.GetChannel(), msg5.GetChannel())
334334
require.Equal(t, msg1.GetChannel(), msg6.GetChannel())
335-
require.Equal(t, msg1.GetChannel().Endpoint.ChannelID, CHANNEL_ID)
335+
require.Equal(t, CHANNEL_ID, msg1.GetChannel().Endpoint.ChannelID)
336336
}
337337

338338
func TestIBCMsgGetCounterVersion(t *testing.T) {

internal/api/iterator_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"sync"
77
"testing"
88

9-
"github.com/stretchr/testify/assert"
109
"github.com/stretchr/testify/require"
1110

1211
"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
@@ -202,14 +201,14 @@ func TestQueueIteratorSimple(t *testing.T) {
202201
err = json.Unmarshal(data, &reduced)
203202
require.NoError(t, err)
204203
require.Equal(t, "", reduced.Err)
205-
require.Equal(t, `{"counters":[[17,22],[22,0]]}`, string(reduced.Ok))
204+
require.JSONEq(t, `{"counters":[[17,22],[22,0]]}`, string(reduced.Ok))
206205
}
207206

208207
func TestQueueIteratorRaces(t *testing.T) {
209208
cache, cleanup := withCache(t)
210209
defer cleanup()
211210

212-
assert.Equal(t, 0, len(iteratorFrames))
211+
require.Empty(t, iteratorFrames)
213212

214213
contract1 := setupQueueContractWithData(t, cache, 17, 22)
215214
contract2 := setupQueueContractWithData(t, cache, 1, 19, 6, 35, 8)
@@ -256,7 +255,7 @@ func TestQueueIteratorRaces(t *testing.T) {
256255
wg.Wait()
257256

258257
// when they finish, we should have removed all frames
259-
assert.Equal(t, 0, len(iteratorFrames))
258+
require.Empty(t, iteratorFrames)
260259
}
261260

262261
func TestQueueIteratorLimit(t *testing.T) {

0 commit comments

Comments
 (0)