func (v Validators) Swap(i, j int) {
	it := v[i]
	v[i] = v[j]
	v[j] = it
}
Implements sort interface
package types
import (
	"bytes"
	"fmt"
	"sort"
	"strings"
	"time"
	"gopkg.in/yaml.v2"
	abci "github.com/tendermint/tendermint/abci/types"
	"github.com/tendermint/tendermint/crypto"
	tmtypes "github.com/tendermint/tendermint/types"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/staking/exported"
	"github.com/Dipper-Labs/Dipper-Protocol/codec"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
	sdkerrors "github.com/Dipper-Labs/Dipper-Protocol/types/errors"
)
const (
	MaxMonikerLength  = 70
	MaxIdentityLength = 3000
	MaxWebsiteLength  = 140
	MaxDetailsLength  = 280
)
var _ exported.ValidatorI = Validator{}
type Validator struct {
	OperatorAddress         sdk.ValAddress `json:"operator_address" yaml:"operator_address"`        
	ConsPubKey              crypto.PubKey  `json:"consensus_pubkey" yaml:"consensus_pubkey"`        
	Jailed                  bool           `json:"jailed" yaml:"jailed"`                            
	Status                  sdk.BondStatus `json:"status" yaml:"status"`                            
	Tokens                  sdk.Int        `json:"tokens" yaml:"tokens"`                            
	DelegatorShares         sdk.Dec        `json:"delegator_shares" yaml:"delegator_shares"`        
	Description             Description    `json:"description" yaml:"description"`                  
	UnbondingHeight         int64          `json:"unbonding_height" yaml:"unbonding_height"`        
	UnbondingCompletionTime time.Time      `json:"unbonding_time" yaml:"unbonding_time"`            
	Commission              Commission     `json:"commission" yaml:"commission"`                    
	MinSelfDelegation       sdk.Int        `json:"min_self_delegation" yaml:"min_self_delegation"`  
	SelfDelegation          sdk.Dec        `json:"self_delegation" yaml:"self_delegation"`          
}
func (v Validator) MarshalYAML() (interface{}, error) {
	bs, err := yaml.Marshal(struct {
		OperatorAddress         sdk.ValAddress
		ConsPubKey              string
		Jailed                  bool
		Status                  sdk.BondStatus
		Tokens                  sdk.Int
		DelegatorShares         sdk.Dec
		Description             Description
		UnbondingHeight         int64
		UnbondingCompletionTime time.Time
		Commission              Commission
		MinSelfDelegation       sdk.Int
		SelfDelegation          sdk.Dec
	}{
		OperatorAddress:         v.OperatorAddress,
		ConsPubKey:              sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, v.ConsPubKey),
		Jailed:                  v.Jailed,
		Status:                  v.Status,
		Tokens:                  v.Tokens,
		DelegatorShares:         v.DelegatorShares,
		Description:             v.Description,
		UnbondingHeight:         v.UnbondingHeight,
		UnbondingCompletionTime: v.UnbondingCompletionTime,
		Commission:              v.Commission,
		MinSelfDelegation:       v.MinSelfDelegation,
		SelfDelegation:          v.SelfDelegation,
	})
	if err != nil {
		return nil, err
	}
	return string(bs), nil
}
type Validators []Validator
func (v Validators) String() (out string) {
	for _, val := range v {
		out += val.String() + "\n"
	}
	return strings.TrimSpace(out)
}
func (v Validators) ToSDKValidators() (validators []exported.ValidatorI) {
	for _, val := range v {
		validators = append(validators, val)
	}
	return validators
}
func (v Validators) Sort() {
	sort.Sort(v)
}
func (v Validators) Len() int {
	return len(v)
}
func (v Validators) Less(i, j int) bool {
	return bytes.Compare(v[i].OperatorAddress, v[j].OperatorAddress) == -1
}