prysm-pulse/beacon-chain/chaintest/backend/simulated_backend_test.go
terence tsao 52a987ee44 Change Hashing Function from Blake2b to Sha3 (#1045)
* switched from blake2b to sha3

* fixed test

* use sha3 from eth1.0
2018-12-05 12:13:33 +08:00

37 lines
747 B
Go

package backend
import "testing"
func TestRunChainTest(t *testing.T) {
sb, err := NewSimulatedBackend()
if err != nil {
t.Fatal(err)
}
testCase := &ChainTestCase{
Config: &ChainTestConfig{
ShardCount: 3,
CycleLength: 10,
MinCommitteeSize: 3,
ValidatorCount: 100,
},
}
if err := sb.RunChainTest(testCase); err != nil {
t.Errorf("Could not run chaintest: %v", err)
}
}
func TestRunShuffleTest(t *testing.T) {
sb, err := NewSimulatedBackend()
if err != nil {
t.Fatal(err)
}
testCase := &ShuffleTestCase{
Input: []uint32{1, 2, 3, 4, 5},
Output: []uint32{2, 4, 5, 1, 3},
Seed: "abcde",
}
if err := sb.RunShuffleTest(testCase); err != nil {
t.Errorf("Could not run chaintest: %v", err)
}
}