github.com/leonlxy/hyperledger@v1.0.0-alpha.0.20170427033203-34922035d248/protos/ledger/rwset/kvrwset/kv_rwset.pb.go (about)

     1  // Code generated by protoc-gen-go.
     2  // source: ledger/rwset/kvrwset/kv_rwset.proto
     3  // DO NOT EDIT!
     4  
     5  /*
     6  Package kvrwset is a generated protocol buffer package.
     7  
     8  It is generated from these files:
     9  	ledger/rwset/kvrwset/kv_rwset.proto
    10  
    11  It has these top-level messages:
    12  	KVRWSet
    13  	KVRead
    14  	KVWrite
    15  	Version
    16  	RangeQueryInfo
    17  	QueryReads
    18  	QueryReadsMerkleSummary
    19  */
    20  package kvrwset
    21  
    22  import proto "github.com/golang/protobuf/proto"
    23  import fmt "fmt"
    24  import math "math"
    25  
    26  // Reference imports to suppress errors if they are not otherwise used.
    27  var _ = proto.Marshal
    28  var _ = fmt.Errorf
    29  var _ = math.Inf
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the proto package it is being compiled against.
    33  // A compilation error at this line likely means your copy of the
    34  // proto package needs to be updated.
    35  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    36  
    37  // KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model
    38  type KVRWSet struct {
    39  	Reads            []*KVRead         `protobuf:"bytes,1,rep,name=reads" json:"reads,omitempty"`
    40  	RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo" json:"range_queries_info,omitempty"`
    41  	Writes           []*KVWrite        `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"`
    42  }
    43  
    44  func (m *KVRWSet) Reset()                    { *m = KVRWSet{} }
    45  func (m *KVRWSet) String() string            { return proto.CompactTextString(m) }
    46  func (*KVRWSet) ProtoMessage()               {}
    47  func (*KVRWSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
    48  
    49  func (m *KVRWSet) GetReads() []*KVRead {
    50  	if m != nil {
    51  		return m.Reads
    52  	}
    53  	return nil
    54  }
    55  
    56  func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo {
    57  	if m != nil {
    58  		return m.RangeQueriesInfo
    59  	}
    60  	return nil
    61  }
    62  
    63  func (m *KVRWSet) GetWrites() []*KVWrite {
    64  	if m != nil {
    65  		return m.Writes
    66  	}
    67  	return nil
    68  }
    69  
    70  // KVRead captures a read operation performed during transaction simulation
    71  // A 'nil' version indicates a non-existing key read by the transaction
    72  type KVRead struct {
    73  	Key     string   `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
    74  	Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
    75  }
    76  
    77  func (m *KVRead) Reset()                    { *m = KVRead{} }
    78  func (m *KVRead) String() string            { return proto.CompactTextString(m) }
    79  func (*KVRead) ProtoMessage()               {}
    80  func (*KVRead) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
    81  
    82  func (m *KVRead) GetVersion() *Version {
    83  	if m != nil {
    84  		return m.Version
    85  	}
    86  	return nil
    87  }
    88  
    89  // KVWrite captures a write (update/delete) operation performed during transaction simulation
    90  type KVWrite struct {
    91  	Key      string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
    92  	IsDelete bool   `protobuf:"varint,2,opt,name=is_delete,json=isDelete" json:"is_delete,omitempty"`
    93  	Value    []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
    94  }
    95  
    96  func (m *KVWrite) Reset()                    { *m = KVWrite{} }
    97  func (m *KVWrite) String() string            { return proto.CompactTextString(m) }
    98  func (*KVWrite) ProtoMessage()               {}
    99  func (*KVWrite) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
   100  
   101  // Version encapsulates the version of a Key
   102  // A version of a committed key is maintained as the height of the transaction that committed the key.
   103  // The height is represenetd as a tuple <blockNum, txNum> where the txNum is the height of the transaction
   104  // (starting with 1) within block
   105  type Version struct {
   106  	BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum" json:"block_num,omitempty"`
   107  	TxNum    uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum" json:"tx_num,omitempty"`
   108  }
   109  
   110  func (m *Version) Reset()                    { *m = Version{} }
   111  func (m *Version) String() string            { return proto.CompactTextString(m) }
   112  func (*Version) ProtoMessage()               {}
   113  func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
   114  
   115  // RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation.
   116  // This helps protect transactions from phantom reads by varifying during validation whether any new items
   117  // got committed within the given range between transaction simuation and validation
   118  // (in addition to regular checks for updates/deletes of the existing items).
   119  // readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash
   120  // if the KVReads exceeds a pre-configured numbers
   121  type RangeQueryInfo struct {
   122  	StartKey     string `protobuf:"bytes,1,opt,name=start_key,json=startKey" json:"start_key,omitempty"`
   123  	EndKey       string `protobuf:"bytes,2,opt,name=end_key,json=endKey" json:"end_key,omitempty"`
   124  	ItrExhausted bool   `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted" json:"itr_exhausted,omitempty"`
   125  	// Types that are valid to be assigned to ReadsInfo:
   126  	//	*RangeQueryInfo_RawReads
   127  	//	*RangeQueryInfo_ReadsMerkleHashes
   128  	ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"`
   129  }
   130  
   131  func (m *RangeQueryInfo) Reset()                    { *m = RangeQueryInfo{} }
   132  func (m *RangeQueryInfo) String() string            { return proto.CompactTextString(m) }
   133  func (*RangeQueryInfo) ProtoMessage()               {}
   134  func (*RangeQueryInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
   135  
   136  type isRangeQueryInfo_ReadsInfo interface {
   137  	isRangeQueryInfo_ReadsInfo()
   138  }
   139  
   140  type RangeQueryInfo_RawReads struct {
   141  	RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,oneof"`
   142  }
   143  type RangeQueryInfo_ReadsMerkleHashes struct {
   144  	ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,oneof"`
   145  }
   146  
   147  func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo()          {}
   148  func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {}
   149  
   150  func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo {
   151  	if m != nil {
   152  		return m.ReadsInfo
   153  	}
   154  	return nil
   155  }
   156  
   157  func (m *RangeQueryInfo) GetRawReads() *QueryReads {
   158  	if x, ok := m.GetReadsInfo().(*RangeQueryInfo_RawReads); ok {
   159  		return x.RawReads
   160  	}
   161  	return nil
   162  }
   163  
   164  func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary {
   165  	if x, ok := m.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok {
   166  		return x.ReadsMerkleHashes
   167  	}
   168  	return nil
   169  }
   170  
   171  // XXX_OneofFuncs is for the internal use of the proto package.
   172  func (*RangeQueryInfo) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
   173  	return _RangeQueryInfo_OneofMarshaler, _RangeQueryInfo_OneofUnmarshaler, _RangeQueryInfo_OneofSizer, []interface{}{
   174  		(*RangeQueryInfo_RawReads)(nil),
   175  		(*RangeQueryInfo_ReadsMerkleHashes)(nil),
   176  	}
   177  }
   178  
   179  func _RangeQueryInfo_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
   180  	m := msg.(*RangeQueryInfo)
   181  	// reads_info
   182  	switch x := m.ReadsInfo.(type) {
   183  	case *RangeQueryInfo_RawReads:
   184  		b.EncodeVarint(4<<3 | proto.WireBytes)
   185  		if err := b.EncodeMessage(x.RawReads); err != nil {
   186  			return err
   187  		}
   188  	case *RangeQueryInfo_ReadsMerkleHashes:
   189  		b.EncodeVarint(5<<3 | proto.WireBytes)
   190  		if err := b.EncodeMessage(x.ReadsMerkleHashes); err != nil {
   191  			return err
   192  		}
   193  	case nil:
   194  	default:
   195  		return fmt.Errorf("RangeQueryInfo.ReadsInfo has unexpected type %T", x)
   196  	}
   197  	return nil
   198  }
   199  
   200  func _RangeQueryInfo_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
   201  	m := msg.(*RangeQueryInfo)
   202  	switch tag {
   203  	case 4: // reads_info.raw_reads
   204  		if wire != proto.WireBytes {
   205  			return true, proto.ErrInternalBadWireType
   206  		}
   207  		msg := new(QueryReads)
   208  		err := b.DecodeMessage(msg)
   209  		m.ReadsInfo = &RangeQueryInfo_RawReads{msg}
   210  		return true, err
   211  	case 5: // reads_info.reads_merkle_hashes
   212  		if wire != proto.WireBytes {
   213  			return true, proto.ErrInternalBadWireType
   214  		}
   215  		msg := new(QueryReadsMerkleSummary)
   216  		err := b.DecodeMessage(msg)
   217  		m.ReadsInfo = &RangeQueryInfo_ReadsMerkleHashes{msg}
   218  		return true, err
   219  	default:
   220  		return false, nil
   221  	}
   222  }
   223  
   224  func _RangeQueryInfo_OneofSizer(msg proto.Message) (n int) {
   225  	m := msg.(*RangeQueryInfo)
   226  	// reads_info
   227  	switch x := m.ReadsInfo.(type) {
   228  	case *RangeQueryInfo_RawReads:
   229  		s := proto.Size(x.RawReads)
   230  		n += proto.SizeVarint(4<<3 | proto.WireBytes)
   231  		n += proto.SizeVarint(uint64(s))
   232  		n += s
   233  	case *RangeQueryInfo_ReadsMerkleHashes:
   234  		s := proto.Size(x.ReadsMerkleHashes)
   235  		n += proto.SizeVarint(5<<3 | proto.WireBytes)
   236  		n += proto.SizeVarint(uint64(s))
   237  		n += s
   238  	case nil:
   239  	default:
   240  		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
   241  	}
   242  	return n
   243  }
   244  
   245  // QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution
   246  type QueryReads struct {
   247  	KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads" json:"kv_reads,omitempty"`
   248  }
   249  
   250  func (m *QueryReads) Reset()                    { *m = QueryReads{} }
   251  func (m *QueryReads) String() string            { return proto.CompactTextString(m) }
   252  func (*QueryReads) ProtoMessage()               {}
   253  func (*QueryReads) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
   254  
   255  func (m *QueryReads) GetKvReads() []*KVRead {
   256  	if m != nil {
   257  		return m.KvReads
   258  	}
   259  	return nil
   260  }
   261  
   262  // QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads
   263  // This allows to reduce the size of RWSet in the presence of query results
   264  // by storing certain hashes instead of actual results.
   265  // maxDegree field refers to the maximum number of children in the tree at any level
   266  // maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level)
   267  type QueryReadsMerkleSummary struct {
   268  	MaxDegree      uint32   `protobuf:"varint,1,opt,name=max_degree,json=maxDegree" json:"max_degree,omitempty"`
   269  	MaxLevel       uint32   `protobuf:"varint,2,opt,name=max_level,json=maxLevel" json:"max_level,omitempty"`
   270  	MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"`
   271  }
   272  
   273  func (m *QueryReadsMerkleSummary) Reset()                    { *m = QueryReadsMerkleSummary{} }
   274  func (m *QueryReadsMerkleSummary) String() string            { return proto.CompactTextString(m) }
   275  func (*QueryReadsMerkleSummary) ProtoMessage()               {}
   276  func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
   277  
   278  func init() {
   279  	proto.RegisterType((*KVRWSet)(nil), "kvrwset.KVRWSet")
   280  	proto.RegisterType((*KVRead)(nil), "kvrwset.KVRead")
   281  	proto.RegisterType((*KVWrite)(nil), "kvrwset.KVWrite")
   282  	proto.RegisterType((*Version)(nil), "kvrwset.Version")
   283  	proto.RegisterType((*RangeQueryInfo)(nil), "kvrwset.RangeQueryInfo")
   284  	proto.RegisterType((*QueryReads)(nil), "kvrwset.QueryReads")
   285  	proto.RegisterType((*QueryReadsMerkleSummary)(nil), "kvrwset.QueryReadsMerkleSummary")
   286  }
   287  
   288  func init() { proto.RegisterFile("ledger/rwset/kvrwset/kv_rwset.proto", fileDescriptor0) }
   289  
   290  var fileDescriptor0 = []byte{
   291  	// 552 bytes of a gzipped FileDescriptorProto
   292  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x6b, 0xdb, 0x40,
   293  	0x10, 0x8d, 0xec, 0xd8, 0x92, 0xa7, 0x4e, 0xea, 0x6e, 0x5a, 0x22, 0x28, 0x05, 0xa3, 0x50, 0x30,
   294  	0x39, 0x48, 0x90, 0x5e, 0xda, 0x43, 0x2f, 0x25, 0x29, 0x29, 0x69, 0x03, 0xdd, 0x80, 0x03, 0xbd,
   295  	0x88, 0xb5, 0x35, 0xb6, 0x85, 0xf5, 0x91, 0xee, 0xae, 0x6c, 0xf9, 0x54, 0xfa, 0x53, 0xfa, 0x4f,
   296  	0xcb, 0x8e, 0x24, 0x3b, 0x01, 0xb7, 0x27, 0xed, 0xbc, 0x37, 0x6f, 0x76, 0xe6, 0x69, 0x16, 0xce,
   297  	0x12, 0x8c, 0xe6, 0x28, 0x03, 0xb9, 0x56, 0xa8, 0x83, 0xe5, 0xaa, 0xf9, 0x86, 0x74, 0xf0, 0x1f,
   298  	0x64, 0xae, 0x73, 0x66, 0xd7, 0xb8, 0xf7, 0xc7, 0x02, 0xfb, 0x66, 0xcc, 0xef, 0xef, 0x50, 0xb3,
   299  	0xb7, 0xd0, 0x91, 0x28, 0x22, 0xe5, 0x5a, 0xc3, 0xf6, 0xe8, 0xd9, 0xc5, 0x73, 0xbf, 0x4e, 0xf2,
   300  	0x6f, 0xc6, 0x1c, 0x45, 0xc4, 0x2b, 0x96, 0x5d, 0x01, 0x93, 0x22, 0x9b, 0x63, 0xf8, 0xb3, 0x40,
   301  	0x19, 0xa3, 0x0a, 0xe3, 0x6c, 0x96, 0xbb, 0x2d, 0xd2, 0x9c, 0x6e, 0x35, 0xdc, 0xa4, 0x7c, 0x2f,
   302  	0x50, 0x6e, 0xbe, 0x64, 0xb3, 0x9c, 0x0f, 0x64, 0x13, 0xc7, 0xa8, 0x0c, 0xc2, 0x46, 0xd0, 0x5d,
   303  	0xcb, 0x58, 0xa3, 0x72, 0xdb, 0x24, 0x1d, 0x3c, 0xba, 0xee, 0xde, 0x10, 0xbc, 0xe6, 0xbd, 0xcf,
   304  	0xd0, 0xad, 0x3a, 0x60, 0x03, 0x68, 0x2f, 0x71, 0xe3, 0x5a, 0x43, 0x6b, 0xd4, 0xe3, 0xe6, 0xc8,
   305  	0xce, 0xc1, 0x5e, 0xa1, 0x54, 0x71, 0x9e, 0xb9, 0xad, 0xa1, 0xf5, 0xa4, 0xcc, 0xb8, 0xc2, 0x79,
   306  	0x93, 0xe0, 0xdd, 0x9a, 0x51, 0xa9, 0xf4, 0x9e, 0x42, 0xaf, 0xa1, 0x17, 0xab, 0x30, 0xc2, 0x04,
   307  	0x35, 0x52, 0x29, 0x87, 0x3b, 0xb1, 0xba, 0xa4, 0x98, 0xbd, 0x84, 0xce, 0x4a, 0x24, 0x05, 0xba,
   308  	0xed, 0xa1, 0x35, 0xea, 0xf3, 0x2a, 0xf0, 0x3e, 0x82, 0x5d, 0xdf, 0x61, 0xd4, 0x93, 0x24, 0x9f,
   309  	0x2e, 0xc3, 0xac, 0x48, 0xa9, 0xea, 0x21, 0x77, 0x08, 0xb8, 0x2d, 0x52, 0xf6, 0x0a, 0xba, 0xba,
   310  	0x24, 0xa6, 0x45, 0x4c, 0x47, 0x97, 0xb7, 0x45, 0xea, 0xfd, 0x6e, 0xc1, 0xf1, 0x53, 0x97, 0x4c,
   311  	0x19, 0xa5, 0x85, 0xd4, 0xe1, 0xae, 0x39, 0x87, 0x80, 0x1b, 0xdc, 0xb0, 0x53, 0xb0, 0x31, 0x8b,
   312  	0x88, 0x6a, 0x11, 0xd5, 0xc5, 0x2c, 0x32, 0xc4, 0x19, 0x1c, 0xc5, 0x5a, 0x86, 0x58, 0x2e, 0x44,
   313  	0xa1, 0x34, 0x46, 0xd4, 0xa5, 0xc3, 0xfb, 0xb1, 0x96, 0x57, 0x0d, 0xc6, 0x2e, 0xa0, 0x27, 0xc5,
   314  	0x3a, 0xac, 0x7e, 0xf0, 0x21, 0x59, 0x75, 0xb2, 0xb5, 0x8a, 0x3a, 0x30, 0x0e, 0xab, 0xeb, 0x03,
   315  	0xee, 0x48, 0xb1, 0xa6, 0x33, 0xe3, 0x70, 0x42, 0xf9, 0x61, 0x8a, 0x72, 0x99, 0x60, 0xb8, 0x10,
   316  	0x6a, 0x81, 0xca, 0xed, 0x90, 0x7a, 0xb8, 0x47, 0xfd, 0x8d, 0xf2, 0xee, 0x8a, 0x34, 0x15, 0x72,
   317  	0x73, 0x7d, 0xc0, 0x5f, 0xc8, 0x1d, 0x7a, 0x4d, 0xe2, 0x4f, 0x7d, 0x80, 0xaa, 0xa6, 0xd9, 0x1a,
   318  	0xef, 0x3d, 0xc0, 0x4e, 0xcd, 0xce, 0xc1, 0x31, 0x7b, 0xfa, 0xbf, 0x1d, 0xb4, 0x97, 0x2b, 0xca,
   319  	0xf5, 0x7e, 0xc1, 0xe9, 0x3f, 0xee, 0x65, 0x6f, 0x00, 0x52, 0x51, 0x86, 0x11, 0xce, 0x25, 0x22,
   320  	0xd9, 0x78, 0xc4, 0x7b, 0xa9, 0x28, 0x2f, 0x09, 0x30, 0x26, 0x1b, 0x3a, 0xc1, 0x15, 0x26, 0xe4,
   321  	0xe4, 0x11, 0x77, 0x52, 0x51, 0x7e, 0x35, 0x31, 0x1b, 0xc1, 0x60, 0x4b, 0x36, 0xf3, 0x9a, 0xfd,
   322  	0xec, 0xf3, 0xe3, 0x26, 0xa7, 0x1e, 0x24, 0x87, 0x8b, 0x5c, 0xce, 0xfd, 0xc5, 0xe6, 0x01, 0x65,
   323  	0xf5, 0xe4, 0xfc, 0x99, 0x98, 0xc8, 0x78, 0x5a, 0x3d, 0x31, 0xe5, 0xd7, 0x60, 0xd5, 0x7e, 0x3d,
   324  	0xc6, 0x8f, 0x0f, 0xf3, 0x58, 0x2f, 0x8a, 0x89, 0x3f, 0xcd, 0xd3, 0xe0, 0x91, 0x34, 0xa8, 0xa4,
   325  	0x41, 0x25, 0x0d, 0xf6, 0x3d, 0xe1, 0x49, 0x97, 0xc8, 0x77, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff,
   326  	0x7e, 0x2f, 0xc5, 0xa9, 0xe1, 0x03, 0x00, 0x00,
   327  }