mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-06 02:52:19 +00:00
ee99f17fbe
* Add Parlia consensus engine for Binance Smart Chain support * Leave RamanujanBlock as nil in params/config.go * Run `go fmt` on files needing it * Add comment for PoSA * Remove empty branches and ineffectual assignments in parlia.go * Remove commented imports * Fix compilation error * Remove EIP155Signer in transaction_signing.go * Fix compilation issue * Fix go fmt issues * Remove Ramanujan from print statement * Remove references to EthAPIBackend approach * Fix Finalize method across consensus engines * Run go fmt * More linting * Remove more changes * remove a comment * Remove unneeded hashing function * Remove bytes check and fix actual vs expected mistake
24 lines
455 B
Go
24 lines
455 B
Go
package parlia
|
|
|
|
import (
|
|
"bytes"
|
|
"sort"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/ledgerwatch/erigon/common"
|
|
)
|
|
|
|
func TestValidatorSetSort(t *testing.T) {
|
|
size := 100
|
|
validators := make([]common.Address, size)
|
|
for i := 0; i < size; i++ {
|
|
validators[i] = randomAddress()
|
|
}
|
|
sort.Sort(validatorsAscending(validators))
|
|
for i := 0; i < size-1; i++ {
|
|
assert.True(t, bytes.Compare(validators[i][:], validators[i+1][:]) < 0)
|
|
}
|
|
}
|