mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-06 20:53:50 -05:00
Sort validators by index in chain info.
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -270,6 +271,10 @@ func ObtainChainInfoFromNode(ctx context.Context,
|
||||
State: validator.Status,
|
||||
})
|
||||
}
|
||||
// Order validators by index.
|
||||
sort.Slice(res.Validators, func(i int, j int) bool {
|
||||
return res.Validators[i].Index < res.Validators[j].Index
|
||||
})
|
||||
|
||||
// Genesis validators root obtained from beacon node.
|
||||
genesisResponse, err := consensusClient.(consensusclient.GenesisProvider).Genesis(ctx, &api.GenesisOpts{})
|
||||
|
||||
Reference in New Issue
Block a user