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

#ifndef PROTOBUF_C_common_2fresult_2eproto__INCLUDED
#define PROTOBUF_C_common_2fresult_2eproto__INCLUDED

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

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# 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 1003003 < 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


typedef struct _Common__TxResponse Common__TxResponse;
typedef struct _Common__SubscribeResult Common__SubscribeResult;
typedef struct _Common__Result Common__Result;
typedef struct _Common__ContractResult Common__ContractResult;
typedef struct _Common__PrivateGetContract Common__PrivateGetContract;
typedef struct _Common__StrSlice Common__StrSlice;
typedef struct _Common__CertInfos Common__CertInfos;
typedef struct _Common__CertInfo Common__CertInfo;
typedef struct _Common__ContractEvent Common__ContractEvent;
typedef struct _Common__ContractEventInfo Common__ContractEventInfo;
typedef struct _Common__ContractEventInfoList Common__ContractEventInfoList;


/* --- enums --- */

/*
 * TxStatusCode describes the tx status in tx result
 */
typedef enum _Common__TxStatusCode {
  COMMON__TX_STATUS_CODE__SUCCESS = 0,
  COMMON__TX_STATUS_CODE__TIMEOUT = 1,
  COMMON__TX_STATUS_CODE__INVALID_PARAMETER = 2,
  COMMON__TX_STATUS_CODE__NO_PERMISSION = 3,
  COMMON__TX_STATUS_CODE__CONTRACT_FAIL = 4,
  COMMON__TX_STATUS_CODE__INTERNAL_ERROR = 5,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_TRANSACTION_TYPE = 10,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_CONTRACT_NAME = 11,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_METHOD = 12,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_INIT_METHOD = 13,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_UPGRADE_METHOD = 14,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_BYTE_CODE = 15,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_RUNTIME_TYPE = 16,
  COMMON__TX_STATUS_CODE__INVALID_CONTRACT_PARAMETER_VERSION = 17,
  COMMON__TX_STATUS_CODE__GET_FROM_TX_CONTEXT_FAILED = 20,
  COMMON__TX_STATUS_CODE__PUT_INTO_TX_CONTEXT_FAILED = 21,
  COMMON__TX_STATUS_CODE__CONTRACT_VERSION_EXIST_FAILED = 22,
  COMMON__TX_STATUS_CODE__CONTRACT_VERSION_NOT_EXIST_FAILED = 23,
  COMMON__TX_STATUS_CODE__CONTRACT_BYTE_CODE_NOT_EXIST_FAILED = 24,
  COMMON__TX_STATUS_CODE__MARSHAL_SENDER_FAILED = 25,
  COMMON__TX_STATUS_CODE__INVOKE_INIT_METHOD_FAILED = 26,
  COMMON__TX_STATUS_CODE__INVOKE_UPGRADE_METHOD_FAILED = 27,
  COMMON__TX_STATUS_CODE__CREATE_RUNTIME_INSTANCE_FAILED = 28,
  COMMON__TX_STATUS_CODE__UNMARSHAL_CREATOR_FAILED = 29,
  COMMON__TX_STATUS_CODE__UNMARSHAL_SENDER_FAILED = 30,
  COMMON__TX_STATUS_CODE__GET_SENDER_PK_FAILED = 31,
  COMMON__TX_STATUS_CODE__GET_CREATOR_PK_FAILED = 32,
  COMMON__TX_STATUS_CODE__GET_CREATOR_FAILED = 33,
  COMMON__TX_STATUS_CODE__GET_CREATOR_CERT_FAILED = 34,
  COMMON__TX_STATUS_CODE__GET_SENDER_CERT_FAILED = 35,
  COMMON__TX_STATUS_CODE__CONTRACT_FREEZE_FAILED = 36,
  COMMON__TX_STATUS_CODE__CONTRACT_TOO_DEEP_FAILED = 37,
  COMMON__TX_STATUS_CODE__CONTRACT_REVOKE_FAILED = 38,
  COMMON__TX_STATUS_CODE__CONTRACT_INVOKE_METHOD_FAILED = 39,
  COMMON__TX_STATUS_CODE__ARCHIVED_TX = 40,
  COMMON__TX_STATUS_CODE__ARCHIVED_BLOCK = 41
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COMMON__TX_STATUS_CODE)
} Common__TxStatusCode;
/*
 * returned by contract
 */
typedef enum _Common__ContractResultCode {
  COMMON__CONTRACT_RESULT_CODE__OK = 0,
  COMMON__CONTRACT_RESULT_CODE__FAIL = 1
    PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(COMMON__CONTRACT_RESULT_CODE)
} Common__ContractResultCode;

/* --- messages --- */

/*
 * tx request - tx response, only for RPC response
 */
struct  _Common__TxResponse
{
  ProtobufCMessage base;
  /*
   * response code
   */
  Common__TxStatusCode code;
  /*
   * response message
   */
  char *message;
  /*
   * returned data, set in smart contract
   */
  Common__ContractResult *contract_result;
};
#define COMMON__TX_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__tx_response__descriptor) \
    , COMMON__TX_STATUS_CODE__SUCCESS, (char *)protobuf_c_empty_string, NULL }


struct  _Common__SubscribeResult
{
  ProtobufCMessage base;
  /*
   * when TxType == SUBSCRIBE_BLOCK_INFO, data type is pb.BlockInfo;
   * when TxType == SUBSCRIBE_TX_INFO，data type is pb.Transaction.
   */
  ProtobufCBinaryData data;
};
#define COMMON__SUBSCRIBE_RESULT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__subscribe_result__descriptor) \
    , {0,NULL} }


/*
 * tx result, part of a transaction in block
 */
struct  _Common__Result
{
  ProtobufCMessage base;
  /*
   * response code
   */
  Common__TxStatusCode code;
  /*
   * returned data, set in smart contract
   */
  Common__ContractResult *contract_result;
  /*
   * hash of the transaction's read-write set
   */
  ProtobufCBinaryData rw_set_hash;
};
#define COMMON__RESULT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__result__descriptor) \
    , COMMON__TX_STATUS_CODE__SUCCESS, NULL, {0,NULL} }


/*
 * invoke user contract method return UserContractReturnPayload
 * Unmarshal from TransactResult.TxResponse.payload
 */
struct  _Common__ContractResult
{
  ProtobufCMessage base;
  /*
   * user contract defined return code, 0-ok, 1-error. for example, insufficient balance in token transfer
   */
  Common__ContractResultCode code;
  /*
   * user contract defined result
   */
  ProtobufCBinaryData result;
  /*
   * user contract defined result message
   */
  char *message;
  /*
   * gas used by current contract(include contract call)
   */
  int64_t gas_used;
  /*
   * contract events
   */
  size_t n_contract_event;
  Common__ContractEvent **contract_event;
};
#define COMMON__CONTRACT_RESULT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__contract_result__descriptor) \
    , COMMON__CONTRACT_RESULT_CODE__OK, {0,NULL}, (char *)protobuf_c_empty_string, 0, 0,NULL }


struct  _Common__PrivateGetContract
{
  ProtobufCMessage base;
  ProtobufCBinaryData contract_code;
  char *version;
  int64_t gas_limit;
};
#define COMMON__PRIVATE_GET_CONTRACT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__private_get_contract__descriptor) \
    , {0,NULL}, (char *)protobuf_c_empty_string, 0 }


struct  _Common__StrSlice
{
  ProtobufCMessage base;
  size_t n_str_arr;
  char **str_arr;
};
#define COMMON__STR_SLICE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__str_slice__descriptor) \
    , 0,NULL }


/*
 * certificate collection
 */
struct  _Common__CertInfos
{
  ProtobufCMessage base;
  size_t n_cert_infos;
  Common__CertInfo **cert_infos;
};
#define COMMON__CERT_INFOS__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__cert_infos__descriptor) \
    , 0,NULL }


/*
 * certificate information
 */
struct  _Common__CertInfo
{
  ProtobufCMessage base;
  /*
   * certificate hash
   */
  char *hash;
  /*
   * certificate contents
   */
  ProtobufCBinaryData cert;
};
#define COMMON__CERT_INFO__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__cert_info__descriptor) \
    , (char *)protobuf_c_empty_string, {0,NULL} }


/*
 * contract event saved in block chain
 */
struct  _Common__ContractEvent
{
  ProtobufCMessage base;
  char *topic;
  char *tx_id;
  char *contract_name;
  char *contract_version;
  size_t n_event_data;
  char **event_data;
};
#define COMMON__CONTRACT_EVENT__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__contract_event__descriptor) \
    , (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0,NULL }


/*
 * contract event published to user
 */
struct  _Common__ContractEventInfo
{
  ProtobufCMessage base;
  int64_t block_height;
  char *chain_id;
  char *topic;
  char *tx_id;
  char *contract_name;
  char *contract_version;
  size_t n_event_data;
  char **event_data;
};
#define COMMON__CONTRACT_EVENT_INFO__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__contract_event_info__descriptor) \
    , 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0,NULL }


/*
 * contract event published to user
 */
struct  _Common__ContractEventInfoList
{
  ProtobufCMessage base;
  size_t n_contract_events;
  Common__ContractEventInfo **contract_events;
};
#define COMMON__CONTRACT_EVENT_INFO_LIST__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__contract_event_info_list__descriptor) \
    , 0,NULL }


/* Common__TxResponse methods */
void   common__tx_response__init
                     (Common__TxResponse         *message);
size_t common__tx_response__get_packed_size
                     (const Common__TxResponse   *message);
size_t common__tx_response__pack
                     (const Common__TxResponse   *message,
                      uint8_t             *out);
size_t common__tx_response__pack_to_buffer
                     (const Common__TxResponse   *message,
                      ProtobufCBuffer     *buffer);
Common__TxResponse *
       common__tx_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__tx_response__free_unpacked
                     (Common__TxResponse *message,
                      ProtobufCAllocator *allocator);
/* Common__SubscribeResult methods */
void   common__subscribe_result__init
                     (Common__SubscribeResult         *message);
size_t common__subscribe_result__get_packed_size
                     (const Common__SubscribeResult   *message);
size_t common__subscribe_result__pack
                     (const Common__SubscribeResult   *message,
                      uint8_t             *out);
size_t common__subscribe_result__pack_to_buffer
                     (const Common__SubscribeResult   *message,
                      ProtobufCBuffer     *buffer);
Common__SubscribeResult *
       common__subscribe_result__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__subscribe_result__free_unpacked
                     (Common__SubscribeResult *message,
                      ProtobufCAllocator *allocator);
/* Common__Result methods */
void   common__result__init
                     (Common__Result         *message);
size_t common__result__get_packed_size
                     (const Common__Result   *message);
size_t common__result__pack
                     (const Common__Result   *message,
                      uint8_t             *out);
size_t common__result__pack_to_buffer
                     (const Common__Result   *message,
                      ProtobufCBuffer     *buffer);
Common__Result *
       common__result__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__result__free_unpacked
                     (Common__Result *message,
                      ProtobufCAllocator *allocator);
/* Common__ContractResult methods */
void   common__contract_result__init
                     (Common__ContractResult         *message);
size_t common__contract_result__get_packed_size
                     (const Common__ContractResult   *message);
size_t common__contract_result__pack
                     (const Common__ContractResult   *message,
                      uint8_t             *out);
size_t common__contract_result__pack_to_buffer
                     (const Common__ContractResult   *message,
                      ProtobufCBuffer     *buffer);
Common__ContractResult *
       common__contract_result__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__contract_result__free_unpacked
                     (Common__ContractResult *message,
                      ProtobufCAllocator *allocator);
/* Common__PrivateGetContract methods */
void   common__private_get_contract__init
                     (Common__PrivateGetContract         *message);
size_t common__private_get_contract__get_packed_size
                     (const Common__PrivateGetContract   *message);
size_t common__private_get_contract__pack
                     (const Common__PrivateGetContract   *message,
                      uint8_t             *out);
size_t common__private_get_contract__pack_to_buffer
                     (const Common__PrivateGetContract   *message,
                      ProtobufCBuffer     *buffer);
Common__PrivateGetContract *
       common__private_get_contract__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__private_get_contract__free_unpacked
                     (Common__PrivateGetContract *message,
                      ProtobufCAllocator *allocator);
/* Common__StrSlice methods */
void   common__str_slice__init
                     (Common__StrSlice         *message);
size_t common__str_slice__get_packed_size
                     (const Common__StrSlice   *message);
size_t common__str_slice__pack
                     (const Common__StrSlice   *message,
                      uint8_t             *out);
size_t common__str_slice__pack_to_buffer
                     (const Common__StrSlice   *message,
                      ProtobufCBuffer     *buffer);
Common__StrSlice *
       common__str_slice__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__str_slice__free_unpacked
                     (Common__StrSlice *message,
                      ProtobufCAllocator *allocator);
/* Common__CertInfos methods */
void   common__cert_infos__init
                     (Common__CertInfos         *message);
size_t common__cert_infos__get_packed_size
                     (const Common__CertInfos   *message);
size_t common__cert_infos__pack
                     (const Common__CertInfos   *message,
                      uint8_t             *out);
size_t common__cert_infos__pack_to_buffer
                     (const Common__CertInfos   *message,
                      ProtobufCBuffer     *buffer);
Common__CertInfos *
       common__cert_infos__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__cert_infos__free_unpacked
                     (Common__CertInfos *message,
                      ProtobufCAllocator *allocator);
/* Common__CertInfo methods */
void   common__cert_info__init
                     (Common__CertInfo         *message);
size_t common__cert_info__get_packed_size
                     (const Common__CertInfo   *message);
size_t common__cert_info__pack
                     (const Common__CertInfo   *message,
                      uint8_t             *out);
size_t common__cert_info__pack_to_buffer
                     (const Common__CertInfo   *message,
                      ProtobufCBuffer     *buffer);
Common__CertInfo *
       common__cert_info__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__cert_info__free_unpacked
                     (Common__CertInfo *message,
                      ProtobufCAllocator *allocator);
/* Common__ContractEvent methods */
void   common__contract_event__init
                     (Common__ContractEvent         *message);
size_t common__contract_event__get_packed_size
                     (const Common__ContractEvent   *message);
size_t common__contract_event__pack
                     (const Common__ContractEvent   *message,
                      uint8_t             *out);
size_t common__contract_event__pack_to_buffer
                     (const Common__ContractEvent   *message,
                      ProtobufCBuffer     *buffer);
Common__ContractEvent *
       common__contract_event__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__contract_event__free_unpacked
                     (Common__ContractEvent *message,
                      ProtobufCAllocator *allocator);
/* Common__ContractEventInfo methods */
void   common__contract_event_info__init
                     (Common__ContractEventInfo         *message);
size_t common__contract_event_info__get_packed_size
                     (const Common__ContractEventInfo   *message);
size_t common__contract_event_info__pack
                     (const Common__ContractEventInfo   *message,
                      uint8_t             *out);
size_t common__contract_event_info__pack_to_buffer
                     (const Common__ContractEventInfo   *message,
                      ProtobufCBuffer     *buffer);
Common__ContractEventInfo *
       common__contract_event_info__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__contract_event_info__free_unpacked
                     (Common__ContractEventInfo *message,
                      ProtobufCAllocator *allocator);
/* Common__ContractEventInfoList methods */
void   common__contract_event_info_list__init
                     (Common__ContractEventInfoList         *message);
size_t common__contract_event_info_list__get_packed_size
                     (const Common__ContractEventInfoList   *message);
size_t common__contract_event_info_list__pack
                     (const Common__ContractEventInfoList   *message,
                      uint8_t             *out);
size_t common__contract_event_info_list__pack_to_buffer
                     (const Common__ContractEventInfoList   *message,
                      ProtobufCBuffer     *buffer);
Common__ContractEventInfoList *
       common__contract_event_info_list__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__contract_event_info_list__free_unpacked
                     (Common__ContractEventInfoList *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Common__TxResponse_Closure)
                 (const Common__TxResponse *message,
                  void *closure_data);
typedef void (*Common__SubscribeResult_Closure)
                 (const Common__SubscribeResult *message,
                  void *closure_data);
typedef void (*Common__Result_Closure)
                 (const Common__Result *message,
                  void *closure_data);
typedef void (*Common__ContractResult_Closure)
                 (const Common__ContractResult *message,
                  void *closure_data);
typedef void (*Common__PrivateGetContract_Closure)
                 (const Common__PrivateGetContract *message,
                  void *closure_data);
typedef void (*Common__StrSlice_Closure)
                 (const Common__StrSlice *message,
                  void *closure_data);
typedef void (*Common__CertInfos_Closure)
                 (const Common__CertInfos *message,
                  void *closure_data);
typedef void (*Common__CertInfo_Closure)
                 (const Common__CertInfo *message,
                  void *closure_data);
typedef void (*Common__ContractEvent_Closure)
                 (const Common__ContractEvent *message,
                  void *closure_data);
typedef void (*Common__ContractEventInfo_Closure)
                 (const Common__ContractEventInfo *message,
                  void *closure_data);
typedef void (*Common__ContractEventInfoList_Closure)
                 (const Common__ContractEventInfoList *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCEnumDescriptor    common__tx_status_code__descriptor;
extern const ProtobufCEnumDescriptor    common__contract_result_code__descriptor;
extern const ProtobufCMessageDescriptor common__tx_response__descriptor;
extern const ProtobufCMessageDescriptor common__subscribe_result__descriptor;
extern const ProtobufCMessageDescriptor common__result__descriptor;
extern const ProtobufCMessageDescriptor common__contract_result__descriptor;
extern const ProtobufCMessageDescriptor common__private_get_contract__descriptor;
extern const ProtobufCMessageDescriptor common__str_slice__descriptor;
extern const ProtobufCMessageDescriptor common__cert_infos__descriptor;
extern const ProtobufCMessageDescriptor common__cert_info__descriptor;
extern const ProtobufCMessageDescriptor common__contract_event__descriptor;
extern const ProtobufCMessageDescriptor common__contract_event_info__descriptor;
extern const ProtobufCMessageDescriptor common__contract_event_info_list__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_common_2fresult_2eproto__INCLUDED */
