mirror of
https://github.com/wealdtech/ethdo.git
synced 2026-01-08 05:34:01 -05:00
Sort validators by index in chain info.
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -270,6 +271,10 @@ func ObtainChainInfoFromNode(ctx context.Context,
|
|||||||
State: validator.Status,
|
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.
|
// Genesis validators root obtained from beacon node.
|
||||||
genesisResponse, err := consensusClient.(consensusclient.GenesisProvider).Genesis(ctx, &api.GenesisOpts{})
|
genesisResponse, err := consensusClient.(consensusclient.GenesisProvider).Genesis(ctx, &api.GenesisOpts{})
|
||||||
|
|||||||
Reference in New Issue
Block a user