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

Function GetSignedProposal

protoutil/txutils.go:357–374  ·  view source on GitHub ↗

GetSignedProposal returns a signed proposal given a Proposal message and a signing identity

(prop *peer.Proposal, signer Signer)

Source from the content-addressed store, hash-verified

355// GetSignedProposal returns a signed proposal given a Proposal message and a
356// signing identity
357func GetSignedProposal(prop *peer.Proposal, signer Signer) (*peer.SignedProposal, error) {
358 // check for nil argument
359 if prop == nil || signer == nil {
360 return nil, errors.New("nil arguments")
361 }
362
363 propBytes, err := proto.Marshal(prop)
364 if err != nil {
365 return nil, err
366 }
367
368 signature, err := signer.Sign(propBytes)
369 if err != nil {
370 return nil, err
371 }
372
373 return &peer.SignedProposal{ProposalBytes: propBytes, Signature: signature}, nil
374}
375
376// MockSignedEndorserProposalOrPanic creates a SignedProposal with the
377// passed arguments

Callers 12

SignedProposalFunction · 0.92
endorserFunction · 0.92
NewProposedTransactionFunction · 0.92
TestGetSignedProposalFunction · 0.92
ChaincodeInvokeOrQueryFunction · 0.92
getBlockChainInfoMethod · 0.92
joinBySnapshotStatusMethod · 0.92
executeJoinFunction · 0.92
getChannelsMethod · 0.92
prepareTestFunction · 0.92

Calls 3

NewMethod · 0.65
MarshalMethod · 0.65
SignMethod · 0.65

Tested by 5

SignedProposalFunction · 0.74
endorserFunction · 0.74
NewProposedTransactionFunction · 0.74
TestGetSignedProposalFunction · 0.74
prepareTestFunction · 0.74