Merge pull request #664 from nspcc-dev/sort-validator-keys
core: sort GetValidators() result
This commit is contained in:
commit
992ccc0b26
2 changed files with 11 additions and 9 deletions
|
@ -194,23 +194,24 @@ func newTestService(t *testing.T) *service {
|
||||||
func getTestValidator(i int) (*privateKey, *publicKey) {
|
func getTestValidator(i int) (*privateKey, *publicKey) {
|
||||||
var wif, password string
|
var wif, password string
|
||||||
|
|
||||||
|
// Sorted by public key.
|
||||||
switch i {
|
switch i {
|
||||||
case 0:
|
case 0:
|
||||||
wif = "6PYLmjBYJ4wQTCEfqvnznGJwZeW9pfUcV5m5oreHxqryUgqKpTRAFt9L8Y"
|
|
||||||
password = "one"
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
wif = "6PYXHjPaNvW8YknSXaKsTWjf9FRxo1s4naV2jdmSQEgzaqKGX368rndN3L"
|
wif = "6PYXHjPaNvW8YknSXaKsTWjf9FRxo1s4naV2jdmSQEgzaqKGX368rndN3L"
|
||||||
password = "two"
|
password = "two"
|
||||||
|
|
||||||
case 2:
|
case 1:
|
||||||
wif = "6PYX86vYiHfUbpD95hfN1xgnvcSxy5skxfWYKu3ztjecxk6ikYs2kcWbeh"
|
|
||||||
password = "three"
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
wif = "6PYRXVwHSqFSukL3CuXxdQ75VmsKpjeLgQLEjt83FrtHf1gCVphHzdD4nc"
|
wif = "6PYRXVwHSqFSukL3CuXxdQ75VmsKpjeLgQLEjt83FrtHf1gCVphHzdD4nc"
|
||||||
password = "four"
|
password = "four"
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
wif = "6PYLmjBYJ4wQTCEfqvnznGJwZeW9pfUcV5m5oreHxqryUgqKpTRAFt9L8Y"
|
||||||
|
password = "one"
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
wif = "6PYX86vYiHfUbpD95hfN1xgnvcSxy5skxfWYKu3ztjecxk6ikYs2kcWbeh"
|
||||||
|
password = "three"
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1413,6 +1413,7 @@ func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.P
|
||||||
result = append(result, uniqueSBValidators[i])
|
result = append(result, uniqueSBValidators[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sort.Sort(result)
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue