/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: peer/transaction.proto */

#ifndef PROTOBUF_C_peer_2ftransaction_2eproto__INCLUDED
#define PROTOBUF_C_peer_2ftransaction_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif

#include "google/protobuf/timestamp.pb-c.h"
#include "peer/proposal_response.pb-c.h"
#include "common/common.pb-c.h"

typedef struct _Protos__SignedTransaction Protos__SignedTransaction;
typedef struct _Protos__ProcessedTransaction Protos__ProcessedTransaction;
typedef struct _Protos__Transaction Protos__Transaction;
typedef struct _Protos__TransactionAction Protos__TransactionAction;
typedef struct _Protos__ChaincodeActionPayload Protos__ChaincodeActionPayload;
typedef struct _Protos__ChaincodeEndorsedAction Protos__ChaincodeEndorsedAction;


/* --- enums --- */

typedef enum _Protos__TxValidationCode {
  PROTOS__TX_VALIDATION_CODE__VALID = 0,
  PROTOS__TX_VALIDATION_CODE__NIL_ENVELOPE = 1,
  PROTOS__TX_VALIDATION_CODE__BAD_PAYLOAD = 2,
  PROTOS__TX_VALIDATION_CODE__BAD_COMMON_HEADER = 3,
  PROTOS__TX_VALIDATION_CODE__BAD_CREATOR_SIGNATURE = 4,
  PROTOS__TX_VALIDATION_CODE__INVALID_ENDORSER_TRANSACTION = 5,
  PROTOS__TX_VALIDATION_CODE__INVALID_CONFIG_TRANSACTION = 6,
  PROTOS__TX_VALIDATION_CODE__UNSUPPORTED_TX_PAYLOAD = 7,
  PROTOS__TX_VALIDATION_CODE__BAD_PROPOSAL_TXID = 8,
  PROTOS__TX_VALIDATION_CODE__DUPLICATE_TXID = 9,
  PROTOS__TX_VALIDATION_CODE__ENDORSEMENT_POLICY_FAILURE = 10,
  PROTOS__TX_VALIDATION_CODE__MVCC_READ_CONFLICT = 11,
  PROTOS__TX_VALIDATION_CODE__PHANTOM_READ_CONFLICT = 12,
  PROTOS__TX_VALIDATION_CODE__UNKNOWN_TX_TYPE = 13,
  PROTOS__TX_VALIDATION_CODE__TARGET_CHAIN_NOT_FOUND = 14,
  PROTOS__TX_VALIDATION_CODE__MARSHAL_TX_ERROR = 15,
  PROTOS__TX_VALIDATION_CODE__NIL_TXACTION = 16,
  PROTOS__TX_VALIDATION_CODE__EXPIRED_CHAINCODE = 17,
  PROTOS__TX_VALIDATION_CODE__CHAINCODE_VERSION_CONFLICT = 18,
  PROTOS__TX_VALIDATION_CODE__BAD_HEADER_EXTENSION = 19,
  PROTOS__TX_VALIDATION_CODE__BAD_CHANNEL_HEADER = 20,
  PROTOS__TX_VALIDATION_CODE__BAD_RESPONSE_PAYLOAD = 21,
  PROTOS__TX_VALIDATION_CODE__BAD_RWSET = 22,
  PROTOS__TX_VALIDATION_CODE__ILLEGAL_WRITESET = 23,
  PROTOS__TX_VALIDATION_CODE__INVALID_WRITESET = 24,
  PROTOS__TX_VALIDATION_CODE__NOT_VALIDATED = 254,
  PROTOS__TX_VALIDATION_CODE__INVALID_OTHER_REASON = 255
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(PROTOS__TX_VALIDATION_CODE)
} Protos__TxValidationCode;
/*
 * Reserved entries in the key-level metadata map
 */
typedef enum _Protos__MetaDataKeys {
  PROTOS__META_DATA_KEYS__VALIDATION_PARAMETER = 0
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(PROTOS__META_DATA_KEYS)
} Protos__MetaDataKeys;

/* --- messages --- */

/*
 * This message is necessary to facilitate the verification of the signature
 * (in the signature field) over the bytes of the transaction (in the
 * transactionBytes field).
 */
struct  _Protos__SignedTransaction
{
  ProtobufCMessage base;
  /*
   * The bytes of the Transaction. NDD
   */
  protobuf_c_boolean has_transaction_bytes;
  ProtobufCBinaryData transaction_bytes;
  /*
   * Signature of the transactionBytes The public key of the signature is in
   * the header field of TransactionAction There might be multiple
   * TransactionAction, so multiple headers, but there should be same
   * transactor identity (cert) in all headers
   */
  protobuf_c_boolean has_signature;
  ProtobufCBinaryData signature;
};
#define PROTOS__SIGNED_TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__signed_transaction__descriptor) \
    , 0,{0,NULL}, 0,{0,NULL} }


/*
 * ProcessedTransaction wraps an Envelope that includes a transaction along with an indication
 * of whether the transaction was validated or invalidated by committing peer.
 * The use case is that GetTransactionByID API needs to retrieve the transaction Envelope
 * from block storage, and return it to a client, and indicate whether the transaction
 * was validated or invalidated by committing peer. So that the originally submitted
 * transaction Envelope is not modified, the ProcessedTransaction wrapper is returned.
 */
struct  _Protos__ProcessedTransaction
{
  ProtobufCMessage base;
  /*
   * An Envelope which includes a processed transaction
   */
  Common__Envelope *transactionenvelope;
  /*
   * An indication of whether the transaction was validated or invalidated by committing peer
   */
  protobuf_c_boolean has_validationcode;
  int32_t validationcode;
};
#define PROTOS__PROCESSED_TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__processed_transaction__descriptor) \
    , NULL, 0,0 }


/*
 * The transaction to be sent to the ordering service. A transaction contains
 * one or more TransactionAction. Each TransactionAction binds a proposal to
 * potentially multiple actions. The transaction is atomic meaning that either
 * all actions in the transaction will be committed or none will.  Note that
 * while a Transaction might include more than one Header, the Header.creator
 * field must be the same in each.
 * A single client is free to issue a number of independent Proposal, each with
 * their header (Header) and request payload (ChaincodeProposalPayload).  Each
 * proposal is independently endorsed generating an action
 * (ProposalResponsePayload) with one signature per Endorser. Any number of
 * independent proposals (and their action) might be included in a transaction
 * to ensure that they are treated atomically.
 */
struct  _Protos__Transaction
{
  ProtobufCMessage base;
  /*
   * The payload is an array of TransactionAction. An array is necessary to
   * accommodate multiple actions per transaction
   */
  size_t n_actions;
  Protos__TransactionAction **actions;
};
#define PROTOS__TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__transaction__descriptor) \
    , 0,NULL }


/*
 * TransactionAction binds a proposal to its action.  The type field in the
 * header dictates the type of action to be applied to the ledger.
 */
struct  _Protos__TransactionAction
{
  ProtobufCMessage base;
  /*
   * The header of the proposal action, which is the proposal header
   */
  protobuf_c_boolean has_header;
  ProtobufCBinaryData header;
  /*
   * The payload of the action as defined by the type in the header For
   * chaincode, it's the bytes of ChaincodeActionPayload
   */
  protobuf_c_boolean has_payload;
  ProtobufCBinaryData payload;
};
#define PROTOS__TRANSACTION_ACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__transaction_action__descriptor) \
    , 0,{0,NULL}, 0,{0,NULL} }


/*
 * ChaincodeActionPayload is the message to be used for the TransactionAction's
 * payload when the Header's type is set to CHAINCODE.  It carries the
 * chaincodeProposalPayload and an endorsed action to apply to the ledger.
 */
struct  _Protos__ChaincodeActionPayload
{
  ProtobufCMessage base;
  /*
   * This field contains the bytes of the ChaincodeProposalPayload message from
   * the original invocation (essentially the arguments) after the application
   * of the visibility function. The main visibility modes are "full" (the
   * entire ChaincodeProposalPayload message is included here), "hash" (only
   * the hash of the ChaincodeProposalPayload message is included) or
   * "nothing".  This field will be used to check the consistency of
   * ProposalResponsePayload.proposalHash.  For the CHAINCODE type,
   * ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader ||
   * f(ChaincodeProposalPayload)) where f is the visibility function.
   */
  protobuf_c_boolean has_chaincode_proposal_payload;
  ProtobufCBinaryData chaincode_proposal_payload;
  /*
   * The list of actions to apply to the ledger
   */
  Protos__ChaincodeEndorsedAction *action;
};
#define PROTOS__CHAINCODE_ACTION_PAYLOAD__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__chaincode_action_payload__descriptor) \
    , 0,{0,NULL}, NULL }


/*
 * ChaincodeEndorsedAction carries information about the endorsement of a
 * specific proposal
 */
struct  _Protos__ChaincodeEndorsedAction
{
  ProtobufCMessage base;
  /*
   * This is the bytes of the ProposalResponsePayload message signed by the
   * endorsers.  Recall that for the CHAINCODE type, the
   * ProposalResponsePayload's extenstion field carries a ChaincodeAction
   */
  protobuf_c_boolean has_proposal_response_payload;
  ProtobufCBinaryData proposal_response_payload;
  /*
   * The endorsement of the proposal, basically the endorser's signature over
   * proposalResponsePayload
   */
  size_t n_endorsements;
  Protos__Endorsement **endorsements;
};
#define PROTOS__CHAINCODE_ENDORSED_ACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&protos__chaincode_endorsed_action__descriptor) \
    , 0,{0,NULL}, 0,NULL }


/* Protos__SignedTransaction methods */
void   protos__signed_transaction__init
                     (Protos__SignedTransaction         *message);
size_t protos__signed_transaction__get_packed_size
                     (const Protos__SignedTransaction   *message);
size_t protos__signed_transaction__pack
                     (const Protos__SignedTransaction   *message,
                      uint8_t             *out);
size_t protos__signed_transaction__pack_to_buffer
                     (const Protos__SignedTransaction   *message,
                      ProtobufCBuffer     *buffer);
Protos__SignedTransaction *
       protos__signed_transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__signed_transaction__free_unpacked
                     (Protos__SignedTransaction *message,
                      ProtobufCAllocator *allocator);
/* Protos__ProcessedTransaction methods */
void   protos__processed_transaction__init
                     (Protos__ProcessedTransaction         *message);
size_t protos__processed_transaction__get_packed_size
                     (const Protos__ProcessedTransaction   *message);
size_t protos__processed_transaction__pack
                     (const Protos__ProcessedTransaction   *message,
                      uint8_t             *out);
size_t protos__processed_transaction__pack_to_buffer
                     (const Protos__ProcessedTransaction   *message,
                      ProtobufCBuffer     *buffer);
Protos__ProcessedTransaction *
       protos__processed_transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__processed_transaction__free_unpacked
                     (Protos__ProcessedTransaction *message,
                      ProtobufCAllocator *allocator);
/* Protos__Transaction methods */
void   protos__transaction__init
                     (Protos__Transaction         *message);
size_t protos__transaction__get_packed_size
                     (const Protos__Transaction   *message);
size_t protos__transaction__pack
                     (const Protos__Transaction   *message,
                      uint8_t             *out);
size_t protos__transaction__pack_to_buffer
                     (const Protos__Transaction   *message,
                      ProtobufCBuffer     *buffer);
Protos__Transaction *
       protos__transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__transaction__free_unpacked
                     (Protos__Transaction *message,
                      ProtobufCAllocator *allocator);
/* Protos__TransactionAction methods */
void   protos__transaction_action__init
                     (Protos__TransactionAction         *message);
size_t protos__transaction_action__get_packed_size
                     (const Protos__TransactionAction   *message);
size_t protos__transaction_action__pack
                     (const Protos__TransactionAction   *message,
                      uint8_t             *out);
size_t protos__transaction_action__pack_to_buffer
                     (const Protos__TransactionAction   *message,
                      ProtobufCBuffer     *buffer);
Protos__TransactionAction *
       protos__transaction_action__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__transaction_action__free_unpacked
                     (Protos__TransactionAction *message,
                      ProtobufCAllocator *allocator);
/* Protos__ChaincodeActionPayload methods */
void   protos__chaincode_action_payload__init
                     (Protos__ChaincodeActionPayload         *message);
size_t protos__chaincode_action_payload__get_packed_size
                     (const Protos__ChaincodeActionPayload   *message);
size_t protos__chaincode_action_payload__pack
                     (const Protos__ChaincodeActionPayload   *message,
                      uint8_t             *out);
size_t protos__chaincode_action_payload__pack_to_buffer
                     (const Protos__ChaincodeActionPayload   *message,
                      ProtobufCBuffer     *buffer);
Protos__ChaincodeActionPayload *
       protos__chaincode_action_payload__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__chaincode_action_payload__free_unpacked
                     (Protos__ChaincodeActionPayload *message,
                      ProtobufCAllocator *allocator);
/* Protos__ChaincodeEndorsedAction methods */
void   protos__chaincode_endorsed_action__init
                     (Protos__ChaincodeEndorsedAction         *message);
size_t protos__chaincode_endorsed_action__get_packed_size
                     (const Protos__ChaincodeEndorsedAction   *message);
size_t protos__chaincode_endorsed_action__pack
                     (const Protos__ChaincodeEndorsedAction   *message,
                      uint8_t             *out);
size_t protos__chaincode_endorsed_action__pack_to_buffer
                     (const Protos__ChaincodeEndorsedAction   *message,
                      ProtobufCBuffer     *buffer);
Protos__ChaincodeEndorsedAction *
       protos__chaincode_endorsed_action__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   protos__chaincode_endorsed_action__free_unpacked
                     (Protos__ChaincodeEndorsedAction *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Protos__SignedTransaction_Closure)
                 (const Protos__SignedTransaction *message,
                  void *closure_data);
typedef void (*Protos__ProcessedTransaction_Closure)
                 (const Protos__ProcessedTransaction *message,
                  void *closure_data);
typedef void (*Protos__Transaction_Closure)
                 (const Protos__Transaction *message,
                  void *closure_data);
typedef void (*Protos__TransactionAction_Closure)
                 (const Protos__TransactionAction *message,
                  void *closure_data);
typedef void (*Protos__ChaincodeActionPayload_Closure)
                 (const Protos__ChaincodeActionPayload *message,
                  void *closure_data);
typedef void (*Protos__ChaincodeEndorsedAction_Closure)
                 (const Protos__ChaincodeEndorsedAction *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCEnumDescriptor    protos__tx_validation_code__descriptor;
extern const ProtobufCEnumDescriptor    protos__meta_data_keys__descriptor;
extern const ProtobufCMessageDescriptor protos__signed_transaction__descriptor;
extern const ProtobufCMessageDescriptor protos__processed_transaction__descriptor;
extern const ProtobufCMessageDescriptor protos__transaction__descriptor;
extern const ProtobufCMessageDescriptor protos__transaction_action__descriptor;
extern const ProtobufCMessageDescriptor protos__chaincode_action_payload__descriptor;
extern const ProtobufCMessageDescriptor protos__chaincode_endorsed_action__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_peer_2ftransaction_2eproto__INCLUDED */
