2020-07-13 01:20:53 +00:00
|
|
|
package p2p
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
2020-07-14 16:51:39 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
2020-07-13 01:20:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestVerifyRPCMappings(t *testing.T) {
|
2020-07-14 16:51:39 +00:00
|
|
|
assert.NoError(t, VerifyTopicMapping(RPCStatusTopic, &pb.Status{}), "Failed to verify status rpc topic")
|
|
|
|
assert.NotNil(t, VerifyTopicMapping(RPCStatusTopic, new([]byte)), "Incorrect message type verified for status rpc topic")
|
2020-07-13 01:20:53 +00:00
|
|
|
|
2020-07-14 16:51:39 +00:00
|
|
|
assert.NoError(t, VerifyTopicMapping(RPCMetaDataTopic, new(interface{})), "Failed to verify metadata rpc topic")
|
|
|
|
assert.NotNil(t, VerifyTopicMapping(RPCStatusTopic, new([]byte)), "Incorrect message type verified for metadata rpc topic")
|
2020-07-13 01:20:53 +00:00
|
|
|
|
2020-07-14 16:51:39 +00:00
|
|
|
assert.NoError(t, VerifyTopicMapping(RPCBlocksByRootTopic, [][32]byte{}), "Failed to verify blocks by root rpc topic")
|
2020-07-13 01:20:53 +00:00
|
|
|
}
|