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

Function CreateChaincodeProposalWithTxIDAndTransient

protoutil/proputils.go:44–57  ·  view source on GitHub ↗

CreateChaincodeProposalWithTxIDAndTransient creates a proposal from given input. It returns the proposal and the transaction id associated with the proposal

(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, creator []byte, txid string, transientMap map[string][]byte)

Source from the content-addressed store, hash-verified

42// input. It returns the proposal and the transaction id associated with the
43// proposal
44func CreateChaincodeProposalWithTxIDAndTransient(typ common.HeaderType, channelID string, cis *peer.ChaincodeInvocationSpec, creator []byte, txid string, transientMap map[string][]byte) (*peer.Proposal, string, error) {
45 // generate a random nonce
46 nonce, err := getRandomNonce()
47 if err != nil {
48 return nil, "", err
49 }
50
51 // compute txid unless provided by tests
52 if txid == "" {
53 txid = ComputeTxID(nonce, creator)
54 }
55
56 return CreateChaincodeProposalWithTxIDNonceAndTransient(txid, typ, channelID, cis, nonce, creator, transientMap)
57}
58
59// CreateChaincodeProposalWithTxIDNonceAndTransient creates a proposal from
60// given input

Callers 6

SignedProposalFunction · 0.92
TestProposalWithTxIDFunction · 0.92
createProposalMethod · 0.92
createProposalMethod · 0.92
createProposalMethod · 0.92
ChaincodeInvokeOrQueryFunction · 0.92

Calls 3

ComputeTxIDFunction · 0.85
getRandomNonceFunction · 0.70

Tested by 2

SignedProposalFunction · 0.74
TestProposalWithTxIDFunction · 0.74