mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
5a66807989
* First take at updating everything to v5 * Patch gRPC gateway to use prysm v5 Fix patch * Update go ssz --------- Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
24 lines
628 B
Go
24 lines
628 B
Go
package rpc
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/testing/assert"
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
|
"google.golang.org/grpc/metadata"
|
|
)
|
|
|
|
func TestGrpcHeaders(t *testing.T) {
|
|
s := &Server{
|
|
ctx: context.Background(),
|
|
clientGrpcHeaders: []string{"first=value1", "second=value2"},
|
|
}
|
|
err := s.registerBeaconClient()
|
|
require.NoError(t, err)
|
|
md, _ := metadata.FromOutgoingContext(s.ctx)
|
|
require.Equal(t, 2, md.Len(), "MetadataV0 contains wrong number of values")
|
|
assert.Equal(t, "value1", md.Get("first")[0])
|
|
assert.Equal(t, "value2", md.Get("second")[0])
|
|
}
|