clean code

This commit is contained in:
Jonathan Gimeno 2020-02-25 15:11:52 +01:00
parent 9ae53260bf
commit 8f779b12b8
2 changed files with 2 additions and 24 deletions

View File

@ -4,12 +4,11 @@ import (
"fmt"
"testing"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
keep "github.com/cosmos/cosmos-sdk/x/staking/keeper"

View File

@ -31,29 +31,8 @@ import (
var (
Addrs = createTestAddrs(500)
PKs = createTestPubKeys(500)
addrDels = []sdk.AccAddress{
Addrs[0],
Addrs[1],
}
addrVals = []sdk.ValAddress{
sdk.ValAddress(Addrs[2]),
sdk.ValAddress(Addrs[3]),
sdk.ValAddress(Addrs[4]),
sdk.ValAddress(Addrs[5]),
sdk.ValAddress(Addrs[6]),
}
)
//_______________________________________________________________________________________
// intended to be used with require/assert: require.True(ValEq(...))
func ValEq(t *testing.T, exp, got types.Validator) (*testing.T, bool, string, types.Validator, types.Validator) {
return t, exp.MinEqual(got), "expected:\n%v\ngot:\n%v", exp, got
}
//_______________________________________________________________________________________
// create a codec used only for testing
func MakeTestCodec() *codec.Codec {
var cdc = codec.New()