2018-06-12 23:03:20 +00:00
|
|
|
package params
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2018-07-26 01:57:19 +00:00
|
|
|
func TestAttesterDeposit(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
2018-06-12 23:03:20 +00:00
|
|
|
want, err := new(big.Int).SetString("1000000000000000000000", 10) // 1000 ETH
|
|
|
|
if !err {
|
|
|
|
t.Fatalf("Failed to setup test")
|
|
|
|
}
|
2018-07-27 00:29:28 +00:00
|
|
|
if c.AttesterDeposit.Cmp(want) != 0 {
|
|
|
|
t.Errorf("Attester deposit size incorrect. Wanted %d, got %d", want, c.AttesterDeposit)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestPeriodLength(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.PeriodLength != 5 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 5, c.PeriodLength)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-26 01:57:19 +00:00
|
|
|
func TestAttesterLockupLength(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.AttesterLockupLength != 16128 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 16128, c.AttesterLockupLength)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProposerLockupLength(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.ProposerLockupLength != 48 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 48, c.ProposerLockupLength)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-26 01:57:19 +00:00
|
|
|
func TestAttesterCommitteeSize(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.AttesterCommitteeSize != 135 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 135, c.AttesterCommitteeSize)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-26 01:57:19 +00:00
|
|
|
func TestAttesterQuorumSize(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.AttesterQuorumSize != 90 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 90, c.AttesterQuorumSize)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-26 01:57:19 +00:00
|
|
|
func TestAttesterChallengePeriod(t *testing.T) {
|
2018-07-27 00:29:28 +00:00
|
|
|
c := DefaultConfig()
|
|
|
|
if c.AttesterChallengePeriod != 25 {
|
|
|
|
t.Errorf("Shard count incorrect. Wanted %d, got %d", 25, c.AttesterChallengePeriod)
|
2018-06-12 23:03:20 +00:00
|
|
|
}
|
|
|
|
}
|