diff --git a/pkg/consensus/consensus_test.go b/pkg/consensus/consensus_test.go index 8fc19be22..db31c204d 100644 --- a/pkg/consensus/consensus_test.go +++ b/pkg/consensus/consensus_test.go @@ -194,23 +194,24 @@ func newTestService(t *testing.T) *service { func getTestValidator(i int) (*privateKey, *publicKey) { var wif, password string + // Sorted by public key. switch i { case 0: - wif = "6PYLmjBYJ4wQTCEfqvnznGJwZeW9pfUcV5m5oreHxqryUgqKpTRAFt9L8Y" - password = "one" - - case 1: wif = "6PYXHjPaNvW8YknSXaKsTWjf9FRxo1s4naV2jdmSQEgzaqKGX368rndN3L" password = "two" - case 2: - wif = "6PYX86vYiHfUbpD95hfN1xgnvcSxy5skxfWYKu3ztjecxk6ikYs2kcWbeh" - password = "three" - - case 3: + case 1: wif = "6PYRXVwHSqFSukL3CuXxdQ75VmsKpjeLgQLEjt83FrtHf1gCVphHzdD4nc" password = "four" + case 2: + wif = "6PYLmjBYJ4wQTCEfqvnznGJwZeW9pfUcV5m5oreHxqryUgqKpTRAFt9L8Y" + password = "one" + + case 3: + wif = "6PYX86vYiHfUbpD95hfN1xgnvcSxy5skxfWYKu3ztjecxk6ikYs2kcWbeh" + password = "three" + default: return nil, nil } diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 0c1ad2495..036031008 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1413,6 +1413,7 @@ func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.P result = append(result, uniqueSBValidators[i]) } } + sort.Sort(result) return result, nil }