prysm-pulse/beacon-chain/db/kv/encoding_test.go
2020-06-30 21:00:49 -07:00

19 lines
355 B
Go

package kv
import (
"context"
"testing"
testpb "github.com/prysmaticlabs/prysm/proto/testing"
)
func Test_encode_handlesNilFromFunction(t *testing.T) {
foo := func() *testpb.Puzzle {
return nil
}
_, err := encode(context.Background(), foo())
if err == nil || err.Error() != "cannot encode nil message" {
t.Fatalf("Wrong error %v", err)
}
}