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

#ifndef PROTOBUF_C_common_2ftransaction_2eproto__INCLUDED
#define PROTOBUF_C_common_2ftransaction_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

#include "common/request.pb-c.h"
#include "common/result.pb-c.h"
#include "common/rwset.pb-c.h"

typedef struct _Common__Transaction Common__Transaction;
typedef struct _Common__TransactionInfo Common__TransactionInfo;
typedef struct _Common__TransactionWithRWSet Common__TransactionWithRWSet;
typedef struct _Common__TransactionInfoWithRWSet Common__TransactionInfoWithRWSet;


/* --- enums --- */


/* --- messages --- */

/*
 * a transaction includes request and its result
 */
struct  _Common__Transaction
{
  ProtobufCMessage base;
  /*
   * payload
   */
  Common__ChainmakerPayload *payload;
  /*
   * sender account and signature
   */
  Common__EndorsementEntry *sender;
  /*
   * endorser accounts and signatures
   */
  size_t n_endorsers;
  Common__EndorsementEntry **endorsers;
  /*
   * result of the transaction
   */
  Common__Result *result;
};
#define COMMON__TRANSACTION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__transaction__descriptor) \
    , NULL, NULL, 0,NULL, NULL }


/*
 * transaction info include transaction and its block height hash and tx index
 */
struct  _Common__TransactionInfo
{
  ProtobufCMessage base;
  /*
   * transaction raw data
   */
  Common__Transaction *transaction;
  /*
   * block height
   */
  uint64_t block_height;
  /*
   * Deprecated, block hash
   */
  ProtobufCBinaryData block_hash;
  /*
   * transaction index in block
   */
  uint32_t tx_index;
  /*
   * block header timestamp
   */
  int64_t block_timestamp;
};
#define COMMON__TRANSACTION_INFO__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__transaction_info__descriptor) \
    , NULL, 0, {0,NULL}, 0, 0 }


/*
 *transaction and read write set
 */
struct  _Common__TransactionWithRWSet
{
  ProtobufCMessage base;
  /*
   * transaction raw data
   */
  Common__Transaction *transaction;
  Common__TxRWSet *rw_set;
};
#define COMMON__TRANSACTION_WITH_RWSET__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__transaction_with_rwset__descriptor) \
    , NULL, NULL }


struct  _Common__TransactionInfoWithRWSet
{
  ProtobufCMessage base;
  /*
   * transaction raw data
   */
  Common__Transaction *transaction;
  /*
   * block height
   */
  uint64_t block_height;
  /*
   * Deprecated, block hash
   */
  ProtobufCBinaryData block_hash;
  /*
   * transaction index in block
   */
  uint32_t tx_index;
  /*
   * block header timestamp
   */
  int64_t block_timestamp;
  Common__TxRWSet *rw_set;
};
#define COMMON__TRANSACTION_INFO_WITH_RWSET__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&common__transaction_info_with_rwset__descriptor) \
    , NULL, 0, {0,NULL}, 0, 0, NULL }


/* Common__Transaction methods */
void   common__transaction__init
                     (Common__Transaction         *message);
size_t common__transaction__get_packed_size
                     (const Common__Transaction   *message);
size_t common__transaction__pack
                     (const Common__Transaction   *message,
                      uint8_t             *out);
size_t common__transaction__pack_to_buffer
                     (const Common__Transaction   *message,
                      ProtobufCBuffer     *buffer);
Common__Transaction *
       common__transaction__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__transaction__free_unpacked
                     (Common__Transaction *message,
                      ProtobufCAllocator *allocator);
/* Common__TransactionInfo methods */
void   common__transaction_info__init
                     (Common__TransactionInfo         *message);
size_t common__transaction_info__get_packed_size
                     (const Common__TransactionInfo   *message);
size_t common__transaction_info__pack
                     (const Common__TransactionInfo   *message,
                      uint8_t             *out);
size_t common__transaction_info__pack_to_buffer
                     (const Common__TransactionInfo   *message,
                      ProtobufCBuffer     *buffer);
Common__TransactionInfo *
       common__transaction_info__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__transaction_info__free_unpacked
                     (Common__TransactionInfo *message,
                      ProtobufCAllocator *allocator);
/* Common__TransactionWithRWSet methods */
void   common__transaction_with_rwset__init
                     (Common__TransactionWithRWSet         *message);
size_t common__transaction_with_rwset__get_packed_size
                     (const Common__TransactionWithRWSet   *message);
size_t common__transaction_with_rwset__pack
                     (const Common__TransactionWithRWSet   *message,
                      uint8_t             *out);
size_t common__transaction_with_rwset__pack_to_buffer
                     (const Common__TransactionWithRWSet   *message,
                      ProtobufCBuffer     *buffer);
Common__TransactionWithRWSet *
       common__transaction_with_rwset__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__transaction_with_rwset__free_unpacked
                     (Common__TransactionWithRWSet *message,
                      ProtobufCAllocator *allocator);
/* Common__TransactionInfoWithRWSet methods */
void   common__transaction_info_with_rwset__init
                     (Common__TransactionInfoWithRWSet         *message);
size_t common__transaction_info_with_rwset__get_packed_size
                     (const Common__TransactionInfoWithRWSet   *message);
size_t common__transaction_info_with_rwset__pack
                     (const Common__TransactionInfoWithRWSet   *message,
                      uint8_t             *out);
size_t common__transaction_info_with_rwset__pack_to_buffer
                     (const Common__TransactionInfoWithRWSet   *message,
                      ProtobufCBuffer     *buffer);
Common__TransactionInfoWithRWSet *
       common__transaction_info_with_rwset__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   common__transaction_info_with_rwset__free_unpacked
                     (Common__TransactionInfoWithRWSet *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Common__Transaction_Closure)
                 (const Common__Transaction *message,
                  void *closure_data);
typedef void (*Common__TransactionInfo_Closure)
                 (const Common__TransactionInfo *message,
                  void *closure_data);
typedef void (*Common__TransactionWithRWSet_Closure)
                 (const Common__TransactionWithRWSet *message,
                  void *closure_data);
typedef void (*Common__TransactionInfoWithRWSet_Closure)
                 (const Common__TransactionInfoWithRWSet *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor common__transaction__descriptor;
extern const ProtobufCMessageDescriptor common__transaction_info__descriptor;
extern const ProtobufCMessageDescriptor common__transaction_with_rwset__descriptor;
extern const ProtobufCMessageDescriptor common__transaction_info_with_rwset__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_common_2ftransaction_2eproto__INCLUDED */
