Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mossid committed Jul 7, 2019
1 parent 21e0b15 commit 203eaf3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
6 changes: 0 additions & 6 deletions x/ibc/02-client/tendermint/tests/tendermint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ import (
"testing"

"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/merkle"
)

func newRoot() merkle.Root {
return merkle.NewRoot(nil, [][]byte{[]byte("test")}, []byte{0x12, 0x34})
}

func testUpdate(t *testing.T, interval int, ok bool) {
node := NewNode(NewMockValidators(100, 10), newRoot())

Expand Down
16 changes: 12 additions & 4 deletions x/ibc/02-client/tendermint/tests/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tendermint

import (
"math/rand"
"crypto/rand"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -23,6 +23,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/merkle"
)

// nolint: unused
func newRoot() merkle.Root {
return merkle.NewRoot(nil, [][]byte{[]byte("test")}, []byte{0x12, 0x34})
}

const chainid = "testchain"

func defaultComponents() (sdk.StoreKey, sdk.Context, stypes.CommitMultiStore, *codec.Codec) {
Expand Down Expand Up @@ -147,6 +152,7 @@ func (node *Node) Set(k, value []byte) {
node.Store.Set(node.Root.Key(k), value)
}

// nolint:deadcode,unused
func testProof(t *testing.T) {
node := NewNode(NewMockValidators(100, 10), newRoot())

Expand All @@ -157,16 +163,18 @@ func testProof(t *testing.T) {
for i := 0; i < 100; i++ {
k := make([]byte, 32)
v := make([]byte, 32)
rand.Read(k)
rand.Read(v)
_, err := rand.Read(k)
require.NoError(t, err)
_, err = rand.Read(v)
require.NoError(t, err)
kvps = append(kvps, cmn.KVPair{Key: k, Value: v})
node.Set(k, v)
}
header := node.Commit()
proofs := []commitment.Proof{}
root := node.Root.Update(header.AppHash)
for _, kvp := range kvps {
v, p := node.Query(t, root.(merkle.Root), []byte(kvp.Key))
v, p := node.Query(t, root.(merkle.Root), kvp.Key)
require.Equal(t, kvp.Value, v)
proofs = append(proofs, p)
}
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/02-client/tendermint/tests/valset.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (vals MockValidators) Sign(header tmtypes.Header) tmtypes.SignedHeader {
Height: header.Height,
Type: tmtypes.PrecommitType,
}
val.MockPV.SignVote(chainid, vote)
_ = val.MockPV.SignVote(chainid, vote)
precommits[i] = vote.CommitSig()
}

Expand Down

0 comments on commit 203eaf3

Please sign in to comment.