mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-26 05:17:22 +00:00
4072eb711f
* More consistent nil return for state * Merge refs/heads/master into nil-state * Add a check for encode(nil) * Merge branch 'nil-state' of github.com:prysmaticlabs/prysm into nil-state * fix test, thanks @rauljordan * fix tests * gofmt
18 lines
322 B
Go
18 lines
322 B
Go
package kv
|
|
|
|
import (
|
|
"testing"
|
|
|
|
testpb "github.com/prysmaticlabs/prysm/proto/testing"
|
|
)
|
|
|
|
func Test_encode_handlesNilFromFunction(t *testing.T) {
|
|
foo := func() *testpb.Puzzle {
|
|
return nil
|
|
}
|
|
_, err := encode(foo())
|
|
if err == nil || err.Error() != "cannot encode nil message" {
|
|
t.Fatalf("Wrong error %v", err)
|
|
}
|
|
}
|