prysm-pulse/sharding/config_test.go
Preston Van Loon a95d979ee9 Merge pull request #85 from prestonvanloon/refactoring
Refactoring sharding package for proposer/client separation

align config with phase 1 spec

update SMC to use 1000eth as collator deposit size

fix deposit for collator_test

fixed config test and added more test cases


Former-commit-id: 7fadb044ec7bb136964781ac271ce6abb4cff86f [formerly d1c93419517a502d37f09560187a9d804bfea940]
Former-commit-id: 9747bdee7a32a4a056402d1f4b0da114c63003b8
2018-04-02 15:49:51 -07:00

47 lines
1.2 KiB
Go

package sharding
import (
"math/big"
"testing"
)
func TestCollatorDeposit(t *testing.T) {
want, err := new(big.Int).SetString("1000000000000000000000", 10) // 1000 ETH
if !err {
t.Fatalf("Failed to setup test")
}
if CollatorDeposit.Cmp(want) != 0 {
t.Errorf("Collator deposit size incorrect. Wanted %d, got %d", want, CollatorDeposit)
}
}
func TestProposerDeposit(t *testing.T) {
want, err := new(big.Int).SetString("1000000000000000000", 10) // 1 ETH
if !err {
t.Fatalf("Failed to setup test")
}
if ProposerDeposit.Cmp(want) != 0 {
t.Errorf("Proposer deposit size incorrect. Wanted %d, got %d", want, ProposerDeposit)
}
}
func TestMinProposerBalance(t *testing.T) {
want, err := new(big.Int).SetString("100000000000000000", 10) // 0.1 ETH
if !err {
t.Fatalf("Failed to setup test")
}
if MinProposerBalance.Cmp(want) != 0 {
t.Errorf("Min proposer balance incorrect. Wanted %d, got %d", want, MinProposerBalance)
}
}
func TestCollatorSubsidy(t *testing.T) {
want, err := new(big.Int).SetString("1000000000000000", 10) // 0.001 ETH
if !err {
t.Fatalf("Failed to setup test")
}
if CollatorSubsidy.Cmp(want) != 0 {
t.Errorf("Collator subsidy size incorrect. Wanted %d, got %d", want, CollatorSubsidy)
}
}