Fix linter errors
This commit is contained in:
parent
3ac55b589d
commit
2378e3431c
|
@ -345,6 +345,7 @@ func handleQueryStore(app *BaseApp, path []string, req abci.RequestQuery) (res a
|
||||||
return queryable.Query(req)
|
return queryable.Query(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func handleQueryP2P(app *BaseApp, path []string, req abci.RequestQuery) (res abci.ResponseQuery) {
|
func handleQueryP2P(app *BaseApp, path []string, req abci.RequestQuery) (res abci.ResponseQuery) {
|
||||||
// "/p2p" prefix for p2p queries
|
// "/p2p" prefix for p2p queries
|
||||||
if len(path) >= 4 {
|
if len(path) >= 4 {
|
||||||
|
|
|
@ -626,12 +626,12 @@ func TestSimulateTx(t *testing.T) {
|
||||||
// simulate a message, check gas reported
|
// simulate a message, check gas reported
|
||||||
result := app.Simulate(tx)
|
result := app.Simulate(tx)
|
||||||
require.True(t, result.IsOK(), result.Log)
|
require.True(t, result.IsOK(), result.Log)
|
||||||
require.Equal(t, int64(gasConsumed), result.GasUsed)
|
require.Equal(t, gasConsumed, result.GasUsed)
|
||||||
|
|
||||||
// simulate again, same result
|
// simulate again, same result
|
||||||
result = app.Simulate(tx)
|
result = app.Simulate(tx)
|
||||||
require.True(t, result.IsOK(), result.Log)
|
require.True(t, result.IsOK(), result.Log)
|
||||||
require.Equal(t, int64(gasConsumed), result.GasUsed)
|
require.Equal(t, gasConsumed, result.GasUsed)
|
||||||
|
|
||||||
// simulate by calling Query with encoded tx
|
// simulate by calling Query with encoded tx
|
||||||
txBytes, err := codec.MarshalBinary(tx)
|
txBytes, err := codec.MarshalBinary(tx)
|
||||||
|
|
|
@ -10,6 +10,8 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/store"
|
"github.com/cosmos/cosmos-sdk/store"
|
||||||
"github.com/cosmos/cosmos-sdk/wire"
|
"github.com/cosmos/cosmos-sdk/wire"
|
||||||
abci "github.com/tendermint/tendermint/abci/types"
|
abci "github.com/tendermint/tendermint/abci/types"
|
||||||
|
@ -17,7 +19,6 @@ import (
|
||||||
tmliteProxy "github.com/tendermint/tendermint/lite/proxy"
|
tmliteProxy "github.com/tendermint/tendermint/lite/proxy"
|
||||||
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetNode returns an RPC client. If the context's client is not defined, an
|
// GetNode returns an RPC client. If the context's client is not defined, an
|
||||||
|
@ -323,6 +324,7 @@ func (ctx CLIContext) query(path string, key cmn.HexBytes) (res []byte, err erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// verifyProof perform response proof verification
|
// verifyProof perform response proof verification
|
||||||
|
// nolint: unparam
|
||||||
func (ctx CLIContext) verifyProof(path string, resp abci.ResponseQuery) error {
|
func (ctx CLIContext) verifyProof(path string, resp abci.ResponseQuery) error {
|
||||||
|
|
||||||
if ctx.Certifier == nil {
|
if ctx.Certifier == nil {
|
||||||
|
|
|
@ -60,6 +60,7 @@ func resolveProjectPath(remoteProjectPath string) string {
|
||||||
return gopath + string(os.PathSeparator) + "src" + string(os.PathSeparator) + remoteProjectPath
|
return gopath + string(os.PathSeparator) + "src" + string(os.PathSeparator) + remoteProjectPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam, errcheck
|
||||||
func copyBasecoinTemplate(projectName string, projectPath string, remoteProjectPath string) {
|
func copyBasecoinTemplate(projectName string, projectPath string, remoteProjectPath string) {
|
||||||
basecoinProjectPath := resolveProjectPath(remoteBasecoinPath)
|
basecoinProjectPath := resolveProjectPath(remoteBasecoinPath)
|
||||||
filepath.Walk(basecoinProjectPath, func(path string, f os.FileInfo, err error) error {
|
filepath.Walk(basecoinProjectPath, func(path string, f os.FileInfo, err error) error {
|
||||||
|
@ -88,6 +89,7 @@ func copyBasecoinTemplate(projectName string, projectPath string, remoteProjectP
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: errcheck
|
||||||
func createGopkg(projectPath string) {
|
func createGopkg(projectPath string) {
|
||||||
// Create gopkg.toml file
|
// Create gopkg.toml file
|
||||||
dependencies := map[string]string{
|
dependencies := map[string]string{
|
||||||
|
@ -111,6 +113,7 @@ func createGopkg(projectPath string) {
|
||||||
ioutil.WriteFile(projectPath+"/Gopkg.toml", []byte(contents), os.ModePerm)
|
ioutil.WriteFile(projectPath+"/Gopkg.toml", []byte(contents), os.ModePerm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: errcheck
|
||||||
func createMakefile(projectPath string) {
|
func createMakefile(projectPath string) {
|
||||||
// Create makefile
|
// Create makefile
|
||||||
// TODO: Should we use tools/ directory as in Cosmos-SDK to get tools for linting etc.
|
// TODO: Should we use tools/ directory as in Cosmos-SDK to get tools for linting etc.
|
||||||
|
|
|
@ -62,6 +62,7 @@ func GetAssocKey(base sdk.ValAddress, assoc sdk.ValAddress) []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Associate associates new address with validator address
|
// Associate associates new address with validator address
|
||||||
|
// nolint: unparam
|
||||||
func (valset ValidatorSet) Associate(ctx sdk.Context, base sdk.ValAddress, assoc sdk.ValAddress) bool {
|
func (valset ValidatorSet) Associate(ctx sdk.Context, base sdk.ValAddress, assoc sdk.ValAddress) bool {
|
||||||
if len(base) != valset.addrLen || len(assoc) != valset.addrLen {
|
if len(base) != valset.addrLen || len(assoc) != valset.addrLen {
|
||||||
return false
|
return false
|
||||||
|
@ -76,6 +77,7 @@ func (valset ValidatorSet) Associate(ctx sdk.Context, base sdk.ValAddress, assoc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dissociate removes association between addresses
|
// Dissociate removes association between addresses
|
||||||
|
// nolint: unparam
|
||||||
func (valset ValidatorSet) Dissociate(ctx sdk.Context, base sdk.ValAddress, assoc sdk.ValAddress) bool {
|
func (valset ValidatorSet) Dissociate(ctx sdk.Context, base sdk.ValAddress, assoc sdk.ValAddress) bool {
|
||||||
if len(base) != valset.addrLen || len(assoc) != valset.addrLen {
|
if len(base) != valset.addrLen || len(assoc) != valset.addrLen {
|
||||||
return false
|
return false
|
||||||
|
@ -90,6 +92,7 @@ func (valset ValidatorSet) Dissociate(ctx sdk.Context, base sdk.ValAddress, asso
|
||||||
}
|
}
|
||||||
|
|
||||||
// Associations returns all associated addresses with a validator
|
// Associations returns all associated addresses with a validator
|
||||||
|
// nolint: unparam
|
||||||
func (valset ValidatorSet) Associations(ctx sdk.Context, base sdk.ValAddress) (res []sdk.ValAddress) {
|
func (valset ValidatorSet) Associations(ctx sdk.Context, base sdk.ValAddress) (res []sdk.ValAddress) {
|
||||||
res = make([]sdk.ValAddress, valset.maxAssoc)
|
res = make([]sdk.ValAddress, valset.maxAssoc)
|
||||||
iter := sdk.KVStorePrefixIterator(valset.store, GetAssocPrefix(base))
|
iter := sdk.KVStorePrefixIterator(valset.store, GetAssocPrefix(base))
|
||||||
|
|
|
@ -344,6 +344,7 @@ func readOrCreatePrivValidator(tmConfig *cfg.Config) crypto.PubKey {
|
||||||
|
|
||||||
// writeGenesisFile creates and writes the genesis configuration to disk. An
|
// writeGenesisFile creates and writes the genesis configuration to disk. An
|
||||||
// error is returned if building or writing the configuration to file fails.
|
// error is returned if building or writing the configuration to file fails.
|
||||||
|
// nolint: unparam
|
||||||
func writeGenesisFile(cdc *wire.Codec, genesisFile, chainID string, validators []tmtypes.GenesisValidator, appState json.RawMessage) error {
|
func writeGenesisFile(cdc *wire.Codec, genesisFile, chainID string, validators []tmtypes.GenesisValidator, appState json.RawMessage) error {
|
||||||
genDoc := tmtypes.GenesisDoc{
|
genDoc := tmtypes.GenesisDoc{
|
||||||
ChainID: chainID,
|
ChainID: chainID,
|
||||||
|
|
|
@ -84,6 +84,7 @@ func startStandAlone(ctx *Context, appCreator AppCreator) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func startInProcess(ctx *Context, appCreator AppCreator) (*node.Node, error) {
|
func startInProcess(ctx *Context, appCreator AppCreator) (*node.Node, error) {
|
||||||
cfg := ctx.Config
|
cfg := ctx.Config
|
||||||
home := cfg.RootDir
|
home := cfg.RootDir
|
||||||
|
|
|
@ -56,6 +56,7 @@ type iavlStore struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CONTRACT: tree should be fully loaded.
|
// CONTRACT: tree should be fully loaded.
|
||||||
|
// nolint: unparam
|
||||||
func newIAVLStore(tree *iavl.MutableTree, numRecent int64, storeEvery int64) *iavlStore {
|
func newIAVLStore(tree *iavl.MutableTree, numRecent int64, storeEvery int64) *iavlStore {
|
||||||
st := &iavlStore{
|
st := &iavlStore{
|
||||||
tree: tree,
|
tree: tree,
|
||||||
|
|
|
@ -2,10 +2,12 @@ package store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/tendermint/iavl"
|
"github.com/tendermint/iavl"
|
||||||
cmn "github.com/tendermint/tendermint/libs/common"
|
cmn "github.com/tendermint/tendermint/libs/common"
|
||||||
"testing"
|
"github.com/tendermint/tendermint/libs/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVerifyMultiStoreCommitInfo(t *testing.T) {
|
func TestVerifyMultiStoreCommitInfo(t *testing.T) {
|
||||||
|
@ -91,7 +93,7 @@ func TestVerifyMultiStoreCommitInfo(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVerifyRangeProof(t *testing.T) {
|
func TestVerifyRangeProof(t *testing.T) {
|
||||||
tree := iavl.NewTree(nil, 0)
|
tree := iavl.NewMutableTree(db.NewMemDB(), 0)
|
||||||
|
|
||||||
rand := cmn.NewRand()
|
rand := cmn.NewRand()
|
||||||
rand.Seed(0) // for determinism
|
rand.Seed(0) // for determinism
|
||||||
|
@ -100,7 +102,7 @@ func TestVerifyRangeProof(t *testing.T) {
|
||||||
tree.Set(key, []byte(rand.Str(8)))
|
tree.Set(key, []byte(rand.Str(8)))
|
||||||
}
|
}
|
||||||
|
|
||||||
root := tree.Hash()
|
root := tree.WorkingHash()
|
||||||
|
|
||||||
key := []byte{0x32}
|
key := []byte{0x32}
|
||||||
val, proof, err := tree.GetWithProof(key)
|
val, proof, err := tree.GetWithProof(key)
|
||||||
|
|
|
@ -179,6 +179,7 @@ func (tkv *TraceKVStore) CacheWrapWithTrace(_ io.Writer, _ TraceContext) CacheWr
|
||||||
|
|
||||||
// writeOperation writes a KVStore operation to the underlying io.Writer as
|
// writeOperation writes a KVStore operation to the underlying io.Writer as
|
||||||
// JSON-encoded data where the key/value pair is base64 encoded.
|
// JSON-encoded data where the key/value pair is base64 encoded.
|
||||||
|
// nolint: errcheck
|
||||||
func writeOperation(w io.Writer, op operation, tc TraceContext, key, value []byte) {
|
func writeOperation(w io.Writer, op operation, tc TraceContext, key, value []byte) {
|
||||||
traceOp := traceOperation{
|
traceOp := traceOperation{
|
||||||
Operation: op,
|
Operation: op,
|
||||||
|
|
|
@ -156,8 +156,8 @@ func TestTestTraceKVStoreIterator(t *testing.T) {
|
||||||
iterator := store.Iterator(nil, nil)
|
iterator := store.Iterator(nil, nil)
|
||||||
|
|
||||||
s, e := iterator.Domain()
|
s, e := iterator.Domain()
|
||||||
require.Equal(t, []uint8([]byte(nil)), s)
|
require.Equal(t, []byte(nil), s)
|
||||||
require.Equal(t, []uint8([]byte(nil)), e)
|
require.Equal(t, []byte(nil), e)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
expectedKey []byte
|
expectedKey []byte
|
||||||
|
@ -212,8 +212,8 @@ func TestTestTraceKVStoreReverseIterator(t *testing.T) {
|
||||||
iterator := store.ReverseIterator(nil, nil)
|
iterator := store.ReverseIterator(nil, nil)
|
||||||
|
|
||||||
s, e := iterator.Domain()
|
s, e := iterator.Domain()
|
||||||
require.Equal(t, []uint8([]byte(nil)), s)
|
require.Equal(t, []byte(nil), s)
|
||||||
require.Equal(t, []uint8([]byte(nil)), e)
|
require.Equal(t, []byte(nil), e)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
expectedKey []byte
|
expectedKey []byte
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
|
|
||||||
// ExecuteT executes the command, pipes any input to STDIN and return STDOUT,
|
// ExecuteT executes the command, pipes any input to STDIN and return STDOUT,
|
||||||
// logging STDOUT/STDERR to t.
|
// logging STDOUT/STDERR to t.
|
||||||
|
// nolint: errcheck
|
||||||
func ExecuteT(t *testing.T, cmd, input string) (out string) {
|
func ExecuteT(t *testing.T, cmd, input string) (out string) {
|
||||||
t.Log("Running", cmn.Cyan(cmd))
|
t.Log("Running", cmn.Cyan(cmd))
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,7 @@ func (aa AccAddress) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format implements the fmt.Formatter interface.
|
// Format implements the fmt.Formatter interface.
|
||||||
|
// nolint: errcheck
|
||||||
func (aa AccAddress) Format(s fmt.State, verb rune) {
|
func (aa AccAddress) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
@ -247,6 +248,7 @@ func (va ValAddress) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format implements the fmt.Formatter interface.
|
// Format implements the fmt.Formatter interface.
|
||||||
|
// nolint: errcheck
|
||||||
func (va ValAddress) Format(s fmt.State, verb rune) {
|
func (va ValAddress) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
@ -361,6 +363,7 @@ func (ca ConsAddress) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format implements the fmt.Formatter interface.
|
// Format implements the fmt.Formatter interface.
|
||||||
|
// nolint: errcheck
|
||||||
func (ca ConsAddress) Format(s fmt.State, verb rune) {
|
func (ca ConsAddress) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
|
|
@ -30,6 +30,7 @@ type Context struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new context
|
// create a new context
|
||||||
|
// nolint: unparam
|
||||||
func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, logger log.Logger) Context {
|
func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, logger log.Logger) Context {
|
||||||
c := Context{
|
c := Context{
|
||||||
Context: context.Background(),
|
Context: context.Background(),
|
||||||
|
|
|
@ -219,6 +219,7 @@ func (err *sdkError) WithDefaultCodespace(cs CodespaceType) Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements ABCIError.
|
// Implements ABCIError.
|
||||||
|
// nolint: errcheck
|
||||||
func (err *sdkError) TraceSDK(format string, args ...interface{}) Error {
|
func (err *sdkError) TraceSDK(format string, args ...interface{}) Error {
|
||||||
err.Trace(1, format, args...)
|
err.Trace(1, format, args...)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -30,6 +30,7 @@ func GetAccountDecoder(cdc *wire.Codec) auth.AccountDecoder {
|
||||||
|
|
||||||
// GetAccountCmd returns a query account that will display the state of the
|
// GetAccountCmd returns a query account that will display the state of the
|
||||||
// account at a given address.
|
// account at a given address.
|
||||||
|
// nolint: unparam
|
||||||
func GetAccountCmd(storeName string, cdc *wire.Codec, decoder auth.AccountDecoder) *cobra.Command {
|
func GetAccountCmd(storeName string, cdc *wire.Codec, decoder auth.AccountDecoder) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "account [address]",
|
Use: "account [address]",
|
||||||
|
|
|
@ -132,6 +132,7 @@ func (vo VoteOption) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Printf / Sprintf, returns bech32 when using %s
|
// For Printf / Sprintf, returns bech32 when using %s
|
||||||
|
// nolint: errcheck
|
||||||
func (vo VoteOption) Format(s fmt.State, verb rune) {
|
func (vo VoteOption) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
|
|
@ -210,6 +210,7 @@ func (keeper Keeper) activateVotingPeriod(ctx sdk.Context, proposal Proposal) {
|
||||||
// Procedures
|
// Procedures
|
||||||
|
|
||||||
// Returns the current Deposit Procedure from the global param store
|
// Returns the current Deposit Procedure from the global param store
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) GetDepositProcedure(ctx sdk.Context) DepositProcedure {
|
func (keeper Keeper) GetDepositProcedure(ctx sdk.Context) DepositProcedure {
|
||||||
var depositProcedure DepositProcedure
|
var depositProcedure DepositProcedure
|
||||||
keeper.ps.Get(ctx, ParamStoreKeyDepositProcedure, &depositProcedure)
|
keeper.ps.Get(ctx, ParamStoreKeyDepositProcedure, &depositProcedure)
|
||||||
|
@ -217,6 +218,7 @@ func (keeper Keeper) GetDepositProcedure(ctx sdk.Context) DepositProcedure {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the current Voting Procedure from the global param store
|
// Returns the current Voting Procedure from the global param store
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) GetVotingProcedure(ctx sdk.Context) VotingProcedure {
|
func (keeper Keeper) GetVotingProcedure(ctx sdk.Context) VotingProcedure {
|
||||||
var votingProcedure VotingProcedure
|
var votingProcedure VotingProcedure
|
||||||
keeper.ps.Get(ctx, ParamStoreKeyVotingProcedure, &votingProcedure)
|
keeper.ps.Get(ctx, ParamStoreKeyVotingProcedure, &votingProcedure)
|
||||||
|
@ -224,20 +226,24 @@ func (keeper Keeper) GetVotingProcedure(ctx sdk.Context) VotingProcedure {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the current Tallying Procedure from the global param store
|
// Returns the current Tallying Procedure from the global param store
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) GetTallyingProcedure(ctx sdk.Context) TallyingProcedure {
|
func (keeper Keeper) GetTallyingProcedure(ctx sdk.Context) TallyingProcedure {
|
||||||
var tallyingProcedure TallyingProcedure
|
var tallyingProcedure TallyingProcedure
|
||||||
keeper.ps.Get(ctx, ParamStoreKeyTallyingProcedure, &tallyingProcedure)
|
keeper.ps.Get(ctx, ParamStoreKeyTallyingProcedure, &tallyingProcedure)
|
||||||
return tallyingProcedure
|
return tallyingProcedure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) setDepositProcedure(ctx sdk.Context, depositProcedure DepositProcedure) {
|
func (keeper Keeper) setDepositProcedure(ctx sdk.Context, depositProcedure DepositProcedure) {
|
||||||
keeper.ps.Set(ctx, ParamStoreKeyDepositProcedure, &depositProcedure)
|
keeper.ps.Set(ctx, ParamStoreKeyDepositProcedure, &depositProcedure)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) setVotingProcedure(ctx sdk.Context, votingProcedure VotingProcedure) {
|
func (keeper Keeper) setVotingProcedure(ctx sdk.Context, votingProcedure VotingProcedure) {
|
||||||
keeper.ps.Set(ctx, ParamStoreKeyVotingProcedure, &votingProcedure)
|
keeper.ps.Set(ctx, ParamStoreKeyVotingProcedure, &votingProcedure)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: errcheck
|
||||||
func (keeper Keeper) setTallyingProcedure(ctx sdk.Context, tallyingProcedure TallyingProcedure) {
|
func (keeper Keeper) setTallyingProcedure(ctx sdk.Context, tallyingProcedure TallyingProcedure) {
|
||||||
keeper.ps.Set(ctx, ParamStoreKeyTallyingProcedure, &tallyingProcedure)
|
keeper.ps.Set(ctx, ParamStoreKeyTallyingProcedure, &tallyingProcedure)
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,7 @@ func (pt ProposalKind) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Printf / Sprintf, returns bech32 when using %s
|
// For Printf / Sprintf, returns bech32 when using %s
|
||||||
|
// nolint: errcheck
|
||||||
func (pt ProposalKind) Format(s fmt.State, verb rune) {
|
func (pt ProposalKind) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
@ -289,6 +290,7 @@ func (status ProposalStatus) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Printf / Sprintf, returns bech32 when using %s
|
// For Printf / Sprintf, returns bech32 when using %s
|
||||||
|
// nolint: errcheck
|
||||||
func (status ProposalStatus) Format(s fmt.State, verb rune) {
|
func (status ProposalStatus) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 's':
|
case 's':
|
||||||
|
|
|
@ -36,6 +36,7 @@ type QueryProposalParams struct {
|
||||||
ProposalID int64
|
ProposalID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryProposalParams
|
var params QueryProposalParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -61,6 +62,7 @@ type QueryDepositParams struct {
|
||||||
Depositer sdk.AccAddress
|
Depositer sdk.AccAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryDepositParams
|
var params QueryDepositParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -82,6 +84,7 @@ type QueryVoteParams struct {
|
||||||
Voter sdk.AccAddress
|
Voter sdk.AccAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryVoteParams
|
var params QueryVoteParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -102,6 +105,7 @@ type QueryDepositsParams struct {
|
||||||
ProposalID int64
|
ProposalID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryDepositParams
|
var params QueryDepositParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -129,6 +133,7 @@ type QueryVotesParams struct {
|
||||||
ProposalID int64
|
ProposalID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryVotesParams
|
var params QueryVotesParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -160,6 +165,7 @@ type QueryProposalsParams struct {
|
||||||
NumLatestProposals int64
|
NumLatestProposals int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryProposals(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryProposals(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
var params QueryProposalsParams
|
var params QueryProposalsParams
|
||||||
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
err2 := keeper.cdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
|
@ -181,6 +187,7 @@ type QueryTallyParams struct {
|
||||||
ProposalID int64
|
ProposalID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper) (res []byte, err sdk.Error) {
|
||||||
// TODO: Dependant on #1914
|
// TODO: Dependant on #1914
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,7 @@ func SimulateMsgDeposit(k gov.Keeper, sk stake.Keeper) simulation.Operation {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SimulateMsgVote
|
// SimulateMsgVote
|
||||||
|
// nolint: unparam
|
||||||
func SimulateMsgVote(k gov.Keeper, sk stake.Keeper) simulation.Operation {
|
func SimulateMsgVote(k gov.Keeper, sk stake.Keeper) simulation.Operation {
|
||||||
return func(tb testing.TB, r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, keys []crypto.PrivKey, log string, event func(string)) (action string, fOp []simulation.FutureOperation, err sdk.Error) {
|
return func(tb testing.TB, r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, keys []crypto.PrivKey, log string, event func(string)) (action string, fOp []simulation.FutureOperation, err sdk.Error) {
|
||||||
key := simulation.RandomKey(r, keys)
|
key := simulation.RandomKey(r, keys)
|
||||||
|
|
|
@ -163,6 +163,7 @@ func query(node string, key []byte, storeName string) (res []byte, err error) {
|
||||||
return context.NewCLIContext().WithNodeURI(node).QueryStore(key, storeName)
|
return context.NewCLIContext().WithNodeURI(node).QueryStore(key, storeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func (c relayCommander) broadcastTx(seq int64, node string, tx []byte) error {
|
func (c relayCommander) broadcastTx(seq int64, node string, tx []byte) error {
|
||||||
_, err := context.NewCLIContext().WithNodeURI(node).BroadcastTx(tx)
|
_, err := context.NewCLIContext().WithNodeURI(node).BroadcastTx(tx)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -86,6 +86,7 @@ func (app *App) CompleteSetup(newKeys []*sdk.KVStoreKey) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitChainer performs custom logic for initialization.
|
// InitChainer performs custom logic for initialization.
|
||||||
|
// nolint: errcheck
|
||||||
func (app *App) InitChainer(ctx sdk.Context, _ abci.RequestInitChain) abci.ResponseInitChain {
|
func (app *App) InitChainer(ctx sdk.Context, _ abci.RequestInitChain) abci.ResponseInitChain {
|
||||||
// Load the genesis accounts
|
// Load the genesis accounts
|
||||||
for _, genacc := range app.GenesisAccounts {
|
for _, genacc := range app.GenesisAccounts {
|
||||||
|
@ -207,6 +208,7 @@ func GeneratePrivKeyAddressPairsFromRand(rand *rand.Rand, n int) (keys []crypto.
|
||||||
|
|
||||||
// RandomSetGenesis set genesis accounts with random coin values using the
|
// RandomSetGenesis set genesis accounts with random coin values using the
|
||||||
// provided addresses and coin denominations.
|
// provided addresses and coin denominations.
|
||||||
|
// nolint: errcheck
|
||||||
func RandomSetGenesis(r *rand.Rand, app *App, addrs []sdk.AccAddress, denoms []string) {
|
func RandomSetGenesis(r *rand.Rand, app *App, addrs []sdk.AccAddress, denoms []string) {
|
||||||
accts := make([]auth.Account, len(addrs), len(addrs))
|
accts := make([]auth.Account, len(addrs), len(addrs))
|
||||||
randCoinIntervals := []BigInterval{
|
randCoinIntervals := []BigInterval{
|
||||||
|
|
|
@ -243,6 +243,7 @@ func getKeys(validators map[string]mockValidator) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// RandomRequestBeginBlock generates a list of signing validators according to the provided list of validators, signing fraction, and evidence fraction
|
// RandomRequestBeginBlock generates a list of signing validators according to the provided list of validators, signing fraction, and evidence fraction
|
||||||
|
// nolint: unparam
|
||||||
func RandomRequestBeginBlock(r *rand.Rand, validators map[string]mockValidator, livenessTransitions TransitionMatrix, evidenceFraction float64,
|
func RandomRequestBeginBlock(r *rand.Rand, validators map[string]mockValidator, livenessTransitions TransitionMatrix, evidenceFraction float64,
|
||||||
pastTimes []time.Time, pastSigningValidators [][]abci.SigningValidator, event func(string), header abci.Header, log string) abci.RequestBeginBlock {
|
pastTimes []time.Time, pastSigningValidators [][]abci.SigningValidator, event func(string), header abci.Header, log string) abci.RequestBeginBlock {
|
||||||
if len(validators) == 0 {
|
if len(validators) == 0 {
|
||||||
|
|
|
@ -23,6 +23,7 @@ func NewKeeper(cdc *wire.Codec, key sdk.StoreKey) Keeper {
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitKeeper constructs a new Keeper with initial parameters
|
// InitKeeper constructs a new Keeper with initial parameters
|
||||||
|
// nolint: errcheck
|
||||||
func InitKeeper(ctx sdk.Context, cdc *wire.Codec, key sdk.StoreKey, params ...interface{}) Keeper {
|
func InitKeeper(ctx sdk.Context, cdc *wire.Codec, key sdk.StoreKey, params ...interface{}) Keeper {
|
||||||
if len(params)%2 != 0 {
|
if len(params)%2 != 0 {
|
||||||
panic("Odd params list length for InitKeeper")
|
panic("Odd params list length for InitKeeper")
|
||||||
|
|
|
@ -15,6 +15,7 @@ func ActivatedParamKey(ty string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitGenesis stores activated type to param store
|
// InitGenesis stores activated type to param store
|
||||||
|
// nolint: errcheck
|
||||||
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) {
|
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) {
|
||||||
for _, ty := range data.ActivatedTypes {
|
for _, ty := range data.ActivatedTypes {
|
||||||
k.set(ctx, ActivatedParamKey(ty), true)
|
k.set(ctx, ActivatedParamKey(ty), true)
|
||||||
|
|
|
@ -19,6 +19,7 @@ func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *wire.Cod
|
||||||
}
|
}
|
||||||
|
|
||||||
// http request handler to query signing info
|
// http request handler to query signing info
|
||||||
|
// nolint: unparam
|
||||||
func signingInfoHandlerFn(cliCtx context.CLIContext, storeName string, cdc *wire.Codec) http.HandlerFunc {
|
func signingInfoHandlerFn(cliCtx context.CLIContext, storeName string, cdc *wire.Codec) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
|
|
|
@ -165,7 +165,7 @@ func TestHandleAbsentValidator(t *testing.T) {
|
||||||
validator, _ := sk.GetValidatorByPubKey(ctx, val)
|
validator, _ := sk.GetValidatorByPubKey(ctx, val)
|
||||||
require.Equal(t, sdk.Bonded, validator.GetStatus())
|
require.Equal(t, sdk.Bonded, validator.GetStatus())
|
||||||
pool := sk.GetPool(ctx)
|
pool := sk.GetPool(ctx)
|
||||||
require.Equal(t, int64(amtInt), pool.BondedTokens.RoundInt64())
|
require.Equal(t, amtInt, pool.BondedTokens.RoundInt64())
|
||||||
|
|
||||||
// 501st block missed
|
// 501st block missed
|
||||||
ctx = ctx.WithBlockHeight(height)
|
ctx = ctx.WithBlockHeight(height)
|
||||||
|
@ -195,7 +195,7 @@ func TestHandleAbsentValidator(t *testing.T) {
|
||||||
// validator should have been slashed
|
// validator should have been slashed
|
||||||
pool = sk.GetPool(ctx)
|
pool = sk.GetPool(ctx)
|
||||||
slashAmt := sdk.NewDec(amtInt).Mul(keeper.SlashFractionDowntime(ctx)).RoundInt64()
|
slashAmt := sdk.NewDec(amtInt).Mul(keeper.SlashFractionDowntime(ctx)).RoundInt64()
|
||||||
require.Equal(t, int64(amtInt)-slashAmt, pool.BondedTokens.RoundInt64())
|
require.Equal(t, amtInt-slashAmt, pool.BondedTokens.RoundInt64())
|
||||||
|
|
||||||
// validator start height should have been changed
|
// validator start height should have been changed
|
||||||
info, found = keeper.getValidatorSigningInfo(ctx, sdk.ConsAddress(val.Address()))
|
info, found = keeper.getValidatorSigningInfo(ctx, sdk.ConsAddress(val.Address()))
|
||||||
|
@ -252,7 +252,7 @@ func TestHandleNewValidator(t *testing.T) {
|
||||||
|
|
||||||
info, found := keeper.getValidatorSigningInfo(ctx, sdk.ConsAddress(val.Address()))
|
info, found := keeper.getValidatorSigningInfo(ctx, sdk.ConsAddress(val.Address()))
|
||||||
require.True(t, found)
|
require.True(t, found)
|
||||||
require.Equal(t, int64(keeper.SignedBlocksWindow(ctx)+1), info.StartHeight)
|
require.Equal(t, keeper.SignedBlocksWindow(ctx)+1, info.StartHeight)
|
||||||
require.Equal(t, int64(2), info.IndexOffset)
|
require.Equal(t, int64(2), info.IndexOffset)
|
||||||
require.Equal(t, int64(1), info.SignedBlocksCounter)
|
require.Equal(t, int64(1), info.SignedBlocksCounter)
|
||||||
require.Equal(t, time.Unix(0, 0).UTC(), info.JailedUntil)
|
require.Equal(t, time.Unix(0, 0).UTC(), info.JailedUntil)
|
||||||
|
@ -296,7 +296,7 @@ func TestHandleAlreadyJailed(t *testing.T) {
|
||||||
require.Equal(t, sdk.Unbonding, validator.GetStatus())
|
require.Equal(t, sdk.Unbonding, validator.GetStatus())
|
||||||
|
|
||||||
// validator should have been slashed
|
// validator should have been slashed
|
||||||
require.Equal(t, int64(amtInt-1), validator.GetTokens().RoundInt64())
|
require.Equal(t, amtInt-1, validator.GetTokens().RoundInt64())
|
||||||
|
|
||||||
// another block missed
|
// another block missed
|
||||||
ctx = ctx.WithBlockHeight(height)
|
ctx = ctx.WithBlockHeight(height)
|
||||||
|
@ -304,6 +304,6 @@ func TestHandleAlreadyJailed(t *testing.T) {
|
||||||
|
|
||||||
// validator should not have been slashed twice
|
// validator should not have been slashed twice
|
||||||
validator, _ = sk.GetValidatorByPubKey(ctx, val)
|
validator, _ = sk.GetValidatorByPubKey(ctx, val)
|
||||||
require.Equal(t, int64(amtInt-1), validator.GetTokens().RoundInt64())
|
require.Equal(t, amtInt-1, validator.GetTokens().RoundInt64())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,7 @@ func getValidators(validatorKVs []sdk.KVPair, cdc *wire.Codec) ([]types.BechVali
|
||||||
}
|
}
|
||||||
|
|
||||||
// gets all Bech32 validators from a key
|
// gets all Bech32 validators from a key
|
||||||
|
// nolint: unparam
|
||||||
func getBech32Validators(storeName string, cliCtx context.CLIContext, cdc *wire.Codec) (
|
func getBech32Validators(storeName string, cliCtx context.CLIContext, cdc *wire.Codec) (
|
||||||
validators []types.BechValidator, httpStatusCode int, errMsg string, err error) {
|
validators []types.BechValidator, httpStatusCode int, errMsg string, err error) {
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,7 @@ func TestIncrementsMsgUnbond(t *testing.T) {
|
||||||
initBond,
|
initBond,
|
||||||
}
|
}
|
||||||
for _, c := range errorCases {
|
for _, c := range errorCases {
|
||||||
unbondShares := sdk.NewDec(int64(c))
|
unbondShares := sdk.NewDec(c)
|
||||||
msgBeginUnbonding := NewMsgBeginUnbonding(delegatorAddr, validatorAddr, unbondShares)
|
msgBeginUnbonding := NewMsgBeginUnbonding(delegatorAddr, validatorAddr, unbondShares)
|
||||||
got = handleMsgBeginUnbonding(ctx, msgBeginUnbonding, keeper)
|
got = handleMsgBeginUnbonding(ctx, msgBeginUnbonding, keeper)
|
||||||
require.False(t, got.IsOK(), "expected unbond msg to fail")
|
require.False(t, got.IsOK(), "expected unbond msg to fail")
|
||||||
|
|
|
@ -68,6 +68,7 @@ func GetValidatorsByPowerIndexKey(validator types.Validator, pool types.Pool) []
|
||||||
|
|
||||||
// get the power ranking of a validator
|
// get the power ranking of a validator
|
||||||
// NOTE the larger values are of higher value
|
// NOTE the larger values are of higher value
|
||||||
|
// nolint: unparam
|
||||||
func getValidatorPowerRank(validator types.Validator, pool types.Pool) []byte {
|
func getValidatorPowerRank(validator types.Validator, pool types.Pool) []byte {
|
||||||
|
|
||||||
potentialPower := validator.Tokens
|
potentialPower := validator.Tokens
|
||||||
|
|
|
@ -203,6 +203,7 @@ func (k Keeper) slashUnbondingDelegation(ctx sdk.Context, unbondingDelegation ty
|
||||||
// the unbonding delegation had enough stake to slash
|
// the unbonding delegation had enough stake to slash
|
||||||
// (the amount actually slashed may be less if there's
|
// (the amount actually slashed may be less if there's
|
||||||
// insufficient stake remaining)
|
// insufficient stake remaining)
|
||||||
|
// nolint: unparam
|
||||||
func (k Keeper) slashRedelegation(ctx sdk.Context, validator types.Validator, redelegation types.Redelegation,
|
func (k Keeper) slashRedelegation(ctx sdk.Context, validator types.Validator, redelegation types.Redelegation,
|
||||||
infractionHeight int64, slashFactor sdk.Dec) (slashAmount sdk.Dec) {
|
infractionHeight int64, slashFactor sdk.Dec) (slashAmount sdk.Dec) {
|
||||||
|
|
||||||
|
|
|
@ -372,6 +372,7 @@ func (k Keeper) updateForJailing(ctx sdk.Context, oldFound bool, oldValidator, n
|
||||||
return newValidator
|
return newValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: unparam
|
||||||
func (k Keeper) getPowerIncreasing(ctx sdk.Context, oldFound bool, oldValidator, newValidator types.Validator) bool {
|
func (k Keeper) getPowerIncreasing(ctx sdk.Context, oldFound bool, oldValidator, newValidator types.Validator) bool {
|
||||||
if oldFound && oldValidator.BondedTokens().LT(newValidator.BondedTokens()) {
|
if oldFound && oldValidator.BondedTokens().LT(newValidator.BondedTokens()) {
|
||||||
return true
|
return true
|
||||||
|
@ -380,6 +381,7 @@ func (k Keeper) getPowerIncreasing(ctx sdk.Context, oldFound bool, oldValidator,
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the bond height and incremented intra-tx counter
|
// get the bond height and incremented intra-tx counter
|
||||||
|
// nolint: unparam
|
||||||
func (k Keeper) bondIncrement(ctx sdk.Context, oldFound bool, oldValidator,
|
func (k Keeper) bondIncrement(ctx sdk.Context, oldFound bool, oldValidator,
|
||||||
newValidator types.Validator) (height int64, intraTxCounter int16) {
|
newValidator types.Validator) (height int64, intraTxCounter int16) {
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ func AllInvariants(ck bank.Keeper, k stake.Keeper, am auth.AccountMapper) simula
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupplyInvariants checks that the total supply reflects all held loose tokens, bonded tokens, and unbonding delegations
|
// SupplyInvariants checks that the total supply reflects all held loose tokens, bonded tokens, and unbonding delegations
|
||||||
|
// nolint: unparam
|
||||||
func SupplyInvariants(ck bank.Keeper, k stake.Keeper, am auth.AccountMapper) simulation.Invariant {
|
func SupplyInvariants(ck bank.Keeper, k stake.Keeper, am auth.AccountMapper) simulation.Invariant {
|
||||||
return func(t *testing.T, app *baseapp.BaseApp, log string) {
|
return func(t *testing.T, app *baseapp.BaseApp, log string) {
|
||||||
ctx := app.NewContext(false, abci.Header{})
|
ctx := app.NewContext(false, abci.Header{})
|
||||||
|
|
|
@ -258,6 +258,7 @@ func SimulateMsgCompleteRedelegate(k stake.Keeper) simulation.Operation {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
|
// nolint: errcheck
|
||||||
func Setup(mapp *mock.App, k stake.Keeper) simulation.RandSetup {
|
func Setup(mapp *mock.App, k stake.Keeper) simulation.RandSetup {
|
||||||
return func(r *rand.Rand, privKeys []crypto.PrivKey) {
|
return func(r *rand.Rand, privKeys []crypto.PrivKey) {
|
||||||
ctx := mapp.NewContext(false, abci.Header{})
|
ctx := mapp.NewContext(false, abci.Header{})
|
||||||
|
|
|
@ -23,7 +23,7 @@ func TestDelegationEqual(t *testing.T) {
|
||||||
ok := d1.Equal(d2)
|
ok := d1.Equal(d2)
|
||||||
require.True(t, ok)
|
require.True(t, ok)
|
||||||
|
|
||||||
d2.ValidatorAddr = sdk.ValAddress(addr3)
|
d2.ValidatorAddr = addr3
|
||||||
d2.Shares = sdk.NewDec(200)
|
d2.Shares = sdk.NewDec(200)
|
||||||
|
|
||||||
ok = d1.Equal(d2)
|
ok = d1.Equal(d2)
|
||||||
|
@ -57,7 +57,7 @@ func TestUnbondingDelegationEqual(t *testing.T) {
|
||||||
ok := ud1.Equal(ud2)
|
ok := ud1.Equal(ud2)
|
||||||
require.True(t, ok)
|
require.True(t, ok)
|
||||||
|
|
||||||
ud2.ValidatorAddr = sdk.ValAddress(addr3)
|
ud2.ValidatorAddr = addr3
|
||||||
|
|
||||||
ud2.MinTime = time.Unix(20*20*2, 0)
|
ud2.MinTime = time.Unix(20*20*2, 0)
|
||||||
ok = ud1.Equal(ud2)
|
ok = ud1.Equal(ud2)
|
||||||
|
|
Loading…
Reference in New Issue