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)
| 42 | // input. It returns the proposal and the transaction id associated with the |
| 43 | // proposal |
| 44 | func 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 |