2018-01-15 00:10:02 +00:00
|
|
|
package sharding
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2018-04-11 15:13:53 +00:00
|
|
|
func TestNotaryDeposit(t *testing.T) {
|
2018-04-01 21:06:00 +00:00
|
|
|
want, err := new(big.Int).SetString("1000000000000000000000", 10) // 1000 ETH
|
2018-01-15 00:10:02 +00:00
|
|
|
if !err {
|
|
|
|
t.Fatalf("Failed to setup test")
|
|
|
|
}
|
2018-04-11 15:13:53 +00:00
|
|
|
if NotaryDeposit.Cmp(want) != 0 {
|
|
|
|
t.Errorf("Notary deposit size incorrect. Wanted %d, got %d", want, NotaryDeposit)
|
2018-04-01 21:06:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-11 15:13:53 +00:00
|
|
|
func TestNotarySubsidy(t *testing.T) {
|
2018-04-01 21:06:00 +00:00
|
|
|
want, err := new(big.Int).SetString("1000000000000000", 10) // 0.001 ETH
|
|
|
|
if !err {
|
|
|
|
t.Fatalf("Failed to setup test")
|
|
|
|
}
|
2018-04-11 15:13:53 +00:00
|
|
|
if NotarySubsidy.Cmp(want) != 0 {
|
|
|
|
t.Errorf("Notary subsidy size incorrect. Wanted %d, got %d", want, NotarySubsidy)
|
2018-01-15 00:10:02 +00:00
|
|
|
}
|
|
|
|
}
|