MCPcopy
hub / github.com/hyperledger/fabric / TestCreateSignedEnvelopeNilSigner

Function TestCreateSignedEnvelopeNilSigner

protoutil/txutils_test.go:365–382  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

363}
364
365func TestCreateSignedEnvelopeNilSigner(t *testing.T) {
366 var env *cb.Envelope
367 channelID := "mychannelID"
368 msg := &cb.ConfigEnvelope{}
369
370 env, err := protoutil.CreateSignedEnvelope(cb.HeaderType_CONFIG, channelID,
371 nil, msg, int32(1), uint64(1))
372 require.NoError(t, err, "Unexpected error creating signed envelope")
373 require.NotNil(t, env, "Envelope should not be nil")
374 require.Empty(t, env.Signature, "Signature should have been empty")
375 payload := &cb.Payload{}
376 err = proto.Unmarshal(env.Payload, payload)
377 require.NoError(t, err, "Failed to unmarshal payload")
378 data := &cb.ConfigEnvelope{}
379 err = proto.Unmarshal(payload.Data, data)
380 require.NoError(t, err, "Expected payload data to be a config envelope")
381 require.True(t, proto.Equal(msg, data), "Payload data does not match expected value")
382}
383
384func TestGetSignedProposal(t *testing.T) {
385 var signedProp *pb.SignedProposal

Callers

nothing calls this directly

Calls 3

CreateSignedEnvelopeFunction · 0.92
UnmarshalMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected