|
@ -3,6 +3,7 @@ package types |
|
|
import ( |
|
|
import ( |
|
|
"bytes" |
|
|
"bytes" |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
|
|
|
"sort" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
//------------------------------------------------------------------------------
|
|
@ -10,6 +11,14 @@ import ( |
|
|
// Validators is a list of validators that implements the Sort interface
|
|
|
// Validators is a list of validators that implements the Sort interface
|
|
|
type Validators []Validator |
|
|
type Validators []Validator |
|
|
|
|
|
|
|
|
|
|
|
var _ sort.Interface = (Validators)(nil) |
|
|
|
|
|
|
|
|
|
|
|
// All these methods for Validators:
|
|
|
|
|
|
// Len, Less and Swap
|
|
|
|
|
|
// are for Validators to implement sort.Interface
|
|
|
|
|
|
// which will be used by the sort package.
|
|
|
|
|
|
// See Issue https://github.com/tendermint/abci/issues/212
|
|
|
|
|
|
|
|
|
func (v Validators) Len() int { |
|
|
func (v Validators) Len() int { |
|
|
return len(v) |
|
|
return len(v) |
|
|
} |
|
|
} |
|
|