MCPcopy Create free account
hub / github.com/tendermint/tendermint / Less

Method Less

types/priv_validator.go:41–52  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

39}
40
41func (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
54func (pvs PrivValidatorsByAddress) Swap(i, j int) {
55 pvs[i], pvs[j] = pvs[j], pvs[i]

Callers

nothing calls this directly

Calls 3

GetPubKeyMethod · 0.65
CompareMethod · 0.65
AddressMethod · 0.65

Tested by

no test coverage detected