def build_proposal(cci_spec, header): """ Create an invoke transaction proposal Args: cci_spec: The spec header: header of the proposal Returns: The created proposal """ cc_payload = proposal_pb2.ChaincodeProposalPayload() cc_payload.input = cci_spec.SerializeToString() proposal = proposal_pb2.Proposal() proposal.header = header.SerializeToString() proposal.payload = cc_payload.SerializeToString() return proposal
def build_cc_proposal(cci_spec, header, transient_map): """Create an chaincode transaction proposal :param transient_map: transient data map :param cci_spec: The spec :param header: header of the proposal :return: The created proposal """ cc_payload = proposal_pb2.ChaincodeProposalPayload() cc_payload.input = cci_spec.SerializeToString() if transient_map: for name, bytes_value in transient_map.items(): cc_payload.TransientMap[name] = bytes_value proposal = proposal_pb2.Proposal() proposal.header = header.SerializeToString() proposal.payload = cc_payload.SerializeToString() return proposal
def build_cc_proposal(cci_spec, header, transient_map): """ Create an chaincode transaction proposal Args: transient_map: transient data map cci_spec: The spec header: header of the proposal Returns: The created proposal """ cc_payload = proposal_pb2.ChaincodeProposalPayload() cc_payload.input = cci_spec.SerializeToString() if transient_map: cc_payload.TransientMap = transient_map proposal = proposal_pb2.Proposal() proposal.header = header.SerializeToString() proposal.payload = cc_payload.SerializeToString() return proposal