mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 21:57:16 +00:00
10f45744d6
* first commit, remote att types * no more agg attestation proto * regen mock * only attestations * proto * att process * fix att references * more tests passing * use att protos * complete * change visibility * use gogoprotobu
36 lines
657 B
Go
36 lines
657 B
Go
package p2p
|
|
|
|
import (
|
|
"fmt"
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/gogo/protobuf/proto"
|
|
testpb "github.com/prysmaticlabs/prysm/proto/testing"
|
|
)
|
|
|
|
func TestMessageType(t *testing.T) {
|
|
tests := []struct {
|
|
msg proto.Message
|
|
expected reflect.Type
|
|
}{
|
|
{
|
|
msg: &testpb.TestMessage{},
|
|
expected: reflect.TypeOf(testpb.TestMessage{}),
|
|
},
|
|
{
|
|
msg: &testpb.Puzzle{},
|
|
expected: reflect.TypeOf(testpb.Puzzle{}),
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(fmt.Sprintf("%v", tt.expected), func(t *testing.T) {
|
|
got := messageType(tt.msg)
|
|
if got != tt.expected {
|
|
t.Errorf("Wanted %v but got %v", tt.expected, got)
|
|
}
|
|
})
|
|
}
|
|
}
|