[#688] pkg/ir/governance: Add public key sorting
Add sorting of passed public keys in `newAlphabetList` function before Alphabet list merge to make returned results more expected. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
361bff216a
commit
bb3f16d487
1 changed files with 5 additions and 0 deletions
|
@ -19,7 +19,12 @@ var (
|
|||
// sidechain list is empty. Function returns `errNotEnoughKeys` if mainnet
|
||||
// list contains less keys than sidechain list. Function returns (nil, nil) if
|
||||
// mainnet list contains all keys from sidechain list.
|
||||
//
|
||||
// Sorts passed slices.
|
||||
func newAlphabetList(sidechain, mainnet keys.PublicKeys) (keys.PublicKeys, error) {
|
||||
sort.Sort(sidechain)
|
||||
sort.Sort(mainnet)
|
||||
|
||||
ln := len(sidechain)
|
||||
if ln == 0 {
|
||||
return nil, errEmptySidechain
|
||||
|
|
Loading…
Reference in a new issue