(i, j int)
| 39 | } |
| 40 | |
| 41 | func (pvs PrivValidatorsByAddress) Less(i, j int) bool { |
| 42 | pvi, err := pvs[i].GetPubKey(context.Background()) |
| 43 | if err != nil { |
| 44 | panic(err) |
| 45 | } |
| 46 | pvj, err := pvs[j].GetPubKey(context.Background()) |
| 47 | if err != nil { |
| 48 | panic(err) |
| 49 | } |
| 50 | |
| 51 | return bytes.Compare(pvi.Address(), pvj.Address()) == -1 |
| 52 | } |
| 53 | |
| 54 | func (pvs PrivValidatorsByAddress) Swap(i, j int) { |
| 55 | pvs[i], pvs[j] = pvs[j], pvs[i] |