Regular sync: pubsub subscriber for beacon blocks (#3220)

* add validation

* add block db check in validation

* merge

* in memory caching of seen blocks

* basic block processing

* Update BUILD.bazel

* use new receiveBlockNoPubsub

* fix build

* add TODO issue numbers

* add TODO issue numbers

* lint
This commit is contained in:
Preston Van Loon
2019-08-22 14:11:52 -04:00
committed by Raul Jordan
parent 2e352cf5ff
commit ce28feea45
11 changed files with 296 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ go_library(
"is_empty.go",
"json_to_pb_converter.go",
"log.go",
"random_bytes.go",
"tempdir.go",
"wait_timeout.go",
],

View File

@@ -0,0 +1,16 @@
package testutil
import (
"crypto/rand"
"testing"
)
// Random32Bytes generates a random 32 byte slice.
func Random32Bytes(t *testing.T) []byte {
b := make([]byte, 32)
_, err := rand.Read(b)
if err != nil {
t.Fatal(err)
}
return b
}