diff --git a/protos/common/configtx.pb.go b/protos/common/configtx.pb.go index c48240b7d8f..5cf7dc0c060 100644 --- a/protos/common/configtx.pb.go +++ b/protos/common/configtx.pb.go @@ -12,6 +12,29 @@ var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// ConfigType is an enumeration of possible types for the config. The type field in the config is +// an int32 for extensibility, but this enum type should generally be used to populate it +type ConfigType int32 + +const ( + ConfigType_CHANNEL ConfigType = 0 + ConfigType_RESOURCE ConfigType = 1 +) + +var ConfigType_name = map[int32]string{ + 0: "CHANNEL", + 1: "RESOURCE", +} +var ConfigType_value = map[string]int32{ + "CHANNEL": 0, + "RESOURCE": 1, +} + +func (x ConfigType) String() string { + return proto.EnumName(ConfigType_name, int32(x)) +} +func (ConfigType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + // ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency // on previous configuration transactions. // @@ -109,6 +132,7 @@ func (*ConfigPolicySchema) Descriptor() ([]byte, []int) { return fileDescriptor1 type Config struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence" json:"sequence,omitempty"` ChannelGroup *ConfigGroup `protobuf:"bytes,2,opt,name=channel_group,json=channelGroup" json:"channel_group,omitempty"` + Type int32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"` } func (m *Config) Reset() { *m = Config{} } @@ -130,6 +154,13 @@ func (m *Config) GetChannelGroup() *ConfigGroup { return nil } +func (m *Config) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + type ConfigUpdateEnvelope struct { ConfigUpdate []byte `protobuf:"bytes,1,opt,name=config_update,json=configUpdate,proto3" json:"config_update,omitempty"` Signatures []*ConfigSignature `protobuf:"bytes,2,rep,name=signatures" json:"signatures,omitempty"` @@ -164,9 +195,11 @@ func (m *ConfigUpdateEnvelope) GetSignatures() []*ConfigSignature { // 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected // 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal type ConfigUpdate struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` - ReadSet *ConfigGroup `protobuf:"bytes,2,opt,name=read_set,json=readSet" json:"read_set,omitempty"` - WriteSet *ConfigGroup `protobuf:"bytes,3,opt,name=write_set,json=writeSet" json:"write_set,omitempty"` + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` + ReadSet *ConfigGroup `protobuf:"bytes,2,opt,name=read_set,json=readSet" json:"read_set,omitempty"` + WriteSet *ConfigGroup `protobuf:"bytes,3,opt,name=write_set,json=writeSet" json:"write_set,omitempty"` + Type int32 `protobuf:"varint,4,opt,name=type" json:"type,omitempty"` + IsolatedData map[string][]byte `protobuf:"bytes,5,rep,name=isolated_data,json=isolatedData" json:"isolated_data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ConfigUpdate) Reset() { *m = ConfigUpdate{} } @@ -195,6 +228,20 @@ func (m *ConfigUpdate) GetWriteSet() *ConfigGroup { return nil } +func (m *ConfigUpdate) GetType() int32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *ConfigUpdate) GetIsolatedData() map[string][]byte { + if m != nil { + return m.IsolatedData + } + return nil +} + // ConfigGroup is the hierarchical data structure for holding config type ConfigGroup struct { Version uint64 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` @@ -345,53 +392,60 @@ func init() { proto.RegisterType((*ConfigValue)(nil), "common.ConfigValue") proto.RegisterType((*ConfigPolicy)(nil), "common.ConfigPolicy") proto.RegisterType((*ConfigSignature)(nil), "common.ConfigSignature") + proto.RegisterEnum("common.ConfigType", ConfigType_name, ConfigType_value) } func init() { proto.RegisterFile("common/configtx.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 674 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x55, 0xdb, 0x6e, 0xd3, 0x40, - 0x10, 0x55, 0xe2, 0xd6, 0x4d, 0x26, 0xe9, 0x85, 0x6d, 0x10, 0xc6, 0x02, 0x51, 0x0c, 0x94, 0x16, - 0x24, 0xa7, 0x94, 0x87, 0x56, 0x48, 0x7d, 0xa1, 0xaa, 0x80, 0x97, 0x0a, 0x1c, 0x2e, 0x52, 0x85, - 0x88, 0x5c, 0x7b, 0xeb, 0x58, 0x75, 0xbc, 0x66, 0xbd, 0x2e, 0xe4, 0x2b, 0xf8, 0x40, 0xfe, 0x80, - 0xaf, 0x40, 0xde, 0x5d, 0x9b, 0x75, 0xe2, 0x24, 0xe2, 0x29, 0x99, 0x99, 0x73, 0xce, 0xec, 0xce, - 0xce, 0x91, 0xe1, 0xb6, 0x47, 0xc6, 0x63, 0x12, 0xf7, 0x3d, 0x12, 0x5f, 0x85, 0x01, 0xfb, 0x69, - 0x27, 0x94, 0x30, 0x82, 0x74, 0x91, 0x36, 0xb7, 0xcb, 0x72, 0xfe, 0x23, 0x8a, 0x66, 0xc1, 0x49, - 0x48, 0x14, 0x7a, 0x21, 0x4e, 0x45, 0xda, 0xba, 0x86, 0x8d, 0x53, 0xae, 0x72, 0x16, 0xdf, 0xe0, - 0x88, 0x24, 0x18, 0xed, 0x82, 0x2e, 0x74, 0x8d, 0xc6, 0x4e, 0x63, 0xaf, 0x73, 0xb8, 0x61, 0x4b, - 0x1d, 0x81, 0x73, 0x64, 0x15, 0xbd, 0x80, 0x4e, 0xe4, 0xa6, 0x6c, 0x98, 0x25, 0xbe, 0xcb, 0xb0, - 0xd1, 0xe4, 0xe0, 0xad, 0x02, 0x5c, 0xc8, 0x39, 0x90, 0x83, 0x3e, 0x71, 0x8c, 0xf5, 0x5b, 0x83, - 0x5b, 0x42, 0xe5, 0x0d, 0x25, 0x59, 0x32, 0xf0, 0x46, 0x78, 0xec, 0xa2, 0x13, 0xd0, 0x83, 0x3c, - 0x4c, 0x8d, 0xc6, 0x8e,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 0xb5, 0x48, 0xb1, 0xdb, 0x22, 0x5e, 0x20, 0xbf, 0x0b, 0xba, 0x14, 0x69, 0x56, 0x3f, 0x20, - 0xf2, 0xc8, 0xb2, 0xba, 0xac, 0xe1, 0x05, 0x6c, 0x4e, 0x99, 0x0d, 0xed, 0xc3, 0x56, 0x69, 0xb7, - 0xe1, 0x08, 0xbb, 0x3e, 0xa6, 0xd2, 0xc1, 0x9b, 0x65, 0xfe, 0x2d, 0x4f, 0xa3, 0x7b, 0xd0, 0x2e, - 0x53, 0xf2, 0x9e, 0xff, 0x12, 0xaf, 0x07, 0xf0, 0x98, 0xd0, 0xc0, 0x1e, 0x4d, 0x12, 0x4c, 0x23, - 0xec, 0x07, 0x98, 0xda, 0x57, 0xee, 0x25, 0x0d, 0x3d, 0xf1, 0x55, 0x4c, 0xe5, 0x89, 0x2f, 0x9e, - 0x07, 0x21, 0x1b, 0x65, 0x97, 0x79, 0xd8, 0x57, 0xc0, 0x7d, 0x01, 0xee, 0x0b, 0xb0, 0xfc, 0xce, - 0x5e, 0xea, 0x3c, 0x7c, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x25, 0x75, 0xfb, 0xf8, 0x9e, 0x07, - 0x00, 0x00, + // 776 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x56, 0xff, 0x6e, 0x12, 0x4b, + 0x14, 0xbe, 0xb0, 0x40, 0xe1, 0x00, 0x2d, 0x9d, 0x72, 0x73, 0xf7, 0x12, 0x8d, 0x75, 0xd5, 0xfe, + 0x32, 0x81, 0x5a, 0xff, 0x68, 0x63, 0xd2, 0x18, 0x45, 0x62, 0x1b, 0x0d, 0xea, 0xd2, 0x6a, 0xd2, + 0x98, 0x90, 0xe9, 0xee, 0x14, 0x36, 0x85, 0x9d, 0x75, 0x77, 0xa8, 0xf2, 0x58, 0x3e, 0x8f, 0x6f, + 0xe0, 0x53, 0x98,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d, 0xe6, 0x97, 0x2d, 0xe8, 0x75, 0xea, 0xbc, 0xdc, + 0x29, 0xa8, 0x76, 0xa7, 0xa0, 0x06, 0x8d, 0x5e, 0x9f, 0xb0, 0x17, 0xc8, 0x6f, 0x41, 0x41, 0x8a, + 0x64, 0x93, 0x3f, 0x7b, 0x32, 0x64, 0x79, 0xba, 0xec, 0xc2, 0x0b, 0x58, 0xbb, 0xb3, 0x0e, 0xd0, + 0x2e, 0xd4, 0xe2, 0x85, 0xd0, 0x1f, 0x12, 0x6c, 0x13, 0x5f, 0xee, 0x98, 0xb5, 0xd8, 0x7f, 0xc2, + 0xdd, 0xe8, 0x1e, 0x94, 0x62, 0x97, 0xcc, 0xf3, 0xd6, 0xb1, 0xb7, 0x0d, 0x20, 0xb4, 0xcf, 0xc2, + 0x37, 0x5b, 0x86, 0x95, 0xf6, 0xc9, 0xab, 0x6e, 0xb7, 0xf3, 0xbe, 0xf6, 0x0f, 0xaa, 0x40, 0xd1, + 0xec, 0xf4, 0x3e, 0x9c, 0x9b, 0xed, 0x4e, 0x2d, 0xf3, 0xba, 0x07, 0x8f, 0xa9, 0x3f, 0x68, 0x0e, + 0xa7, 0x1e, 0xf1, 0x47, 0xc4, 0x1e, 0x10, 0xbf, 0x79, 0x85, 0x2f, 0x7d, 0xc7, 0x12, 0x3f, 0xfa, + 0x81, 0x4c, 0xed, 0xe2, 0xe9, 0xc0, 0x61, 0xc3, 0xc9, 0x65, 0x68, 0xb6, 0x14, 0x70, 0x4b, 0x80, + 0x5b, 0x02, 0x2c, 0xff, 0x8d, 0xb8, 0x2c, 0x70, 0xf3, 0xf9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x08, 0xe9, 0x1f, 0x76, 0x7d, 0x08, 0x00, 0x00, } diff --git a/protos/common/configtx.proto b/protos/common/configtx.proto index c810b82fe70..29f26d33f45 100644 --- a/protos/common/configtx.proto +++ b/protos/common/configtx.proto @@ -1,17 +1,7 @@ /* Copyright IBM Corp. 2017 All Rights Reserved. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +SPDX-License-Identifier: Apache-2.0 */ syntax = "proto3"; @@ -24,6 +14,13 @@ option java_package = "org.hyperledger.fabric.protos.common"; package common; +// ConfigType is an enumeration of possible types for the config. The type field in the config is +// an int32 for extensibility, but this enum type should generally be used to populate it +enum ConfigType { + CHANNEL = 0; // The original and default configuration type, defines parameters for the operation of a channel + RESOURCE = 1; // Defines a set of resource names, and their mapping to policies which restrict access to those resources +} + // ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency // on previous configuration transactions. // @@ -64,7 +61,8 @@ message ConfigPolicySchema {} // Config represents the config for a particular channel message Config { uint64 sequence = 1; - ConfigGroup channel_group = 2; + ConfigGroup channel_group = 2; // channel_group is a bad name for this, it should be changed to root when API breakage is allowed + int32 type = 3; } message ConfigUpdateEnvelope { @@ -82,9 +80,11 @@ message ConfigUpdateEnvelope { // 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected // 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal message ConfigUpdate { - string channel_id = 1; // Which channel this config update is for - ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set - ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions + string channel_id = 1; // Which channel this config update is for + ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set + ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions + int32 type = 4; // The type of config this update is intended for (usually a value from ConfigType enum) , must match the type in the Config message + map isolated_data = 5; // Data which is not to be reflected in the resulting Config, but is still needed for some other purpose. For instance, rscc_seed_data } // ConfigGroup is the hierarchical data structure for holding config diff --git a/protos/peer/admin.pb.go b/protos/peer/admin.pb.go index f05add0c589..e0dcd1f981f 100644 --- a/protos/peer/admin.pb.go +++ b/protos/peer/admin.pb.go @@ -15,6 +15,7 @@ It is generated from these files: peer/proposal.proto peer/proposal_response.proto peer/query.proto + peer/resources.proto peer/signed_cc_dep_spec.proto peer/transaction.proto @@ -61,6 +62,7 @@ It has these top-level messages: ChaincodeInfo ChannelQueryResponse ChannelInfo + Resource SignedChaincodeDeploymentSpec SignedTransaction ProcessedTransaction diff --git a/protos/peer/resources.pb.go b/protos/peer/resources.pb.go new file mode 100644 index 00000000000..6c7664d179b --- /dev/null +++ b/protos/peer/resources.pb.go @@ -0,0 +1,50 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: peer/resources.proto + +package peer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// Resource represents a resource in the peer whose ACL is determined by the policy_ref field +type Resource struct { + PolicyRef string `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef" json:"policy_ref,omitempty"` +} + +func (m *Resource) Reset() { *m = Resource{} } +func (m *Resource) String() string { return proto.CompactTextString(m) } +func (*Resource) ProtoMessage() {} +func (*Resource) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } + +func (m *Resource) GetPolicyRef() string { + if m != nil { + return m.PolicyRef + } + return "" +} + +func init() { + proto.RegisterType((*Resource)(nil), "protos.Resource") +} + +func init() { proto.RegisterFile("peer/resources.proto", fileDescriptor10) } + +var fileDescriptor10 = []byte{ + // 145 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x48, 0x4d, 0x2d, + 0xd2, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x9a, 0x5c, 0x1c, 0x41, 0x50, 0x29, 0x21, 0x59, 0x2e, 0xae, + 0x82, 0xfc, 0x9c, 0xcc, 0xe4, 0xca, 0xf8, 0xa2, 0xd4, 0x34, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, + 0x20, 0x4e, 0x88, 0x48, 0x50, 0x6a, 0x9a, 0x93, 0x3f, 0x97, 0x52, 0x7e, 0x51, 0xba, 0x5e, 0x46, + 0x65, 0x41, 0x6a, 0x51, 0x4e, 0x6a, 0x4a, 0x7a, 0x6a, 0x91, 0x5e, 0x5a, 0x62, 0x52, 0x51, 0x66, + 0x32, 0xc4, 0xc8, 0x62, 0x3d, 0x90, 0x45, 0x51, 0x9a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, + 0xc9, 0xf9, 0xb9, 0xfa, 0x48, 0x4a, 0xf5, 0x21, 0x4a, 0xf5, 0x21, 0x4a, 0xf5, 0x41, 0x4a, 0x93, + 0x20, 0x6e, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xdf, 0x94, 0xe0, 0xa2, 0x00, 0x00, + 0x00, +} diff --git a/protos/peer/resources.proto b/protos/peer/resources.proto new file mode 100644 index 00000000000..223eded4776 --- /dev/null +++ b/protos/peer/resources.proto @@ -0,0 +1,17 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +syntax = "proto3"; + +option java_package = "org.hyperledger.fabric.protos.peer"; +option go_package = "github.com/hyperledger/fabric/protos/peer"; + +package protos; + +// Resource represents a resource in the peer whose ACL is determined by the policy_ref field +message Resource { + string policy_ref = 1; // The policy name to use for this resource +} diff --git a/protos/peer/signed_cc_dep_spec.pb.go b/protos/peer/signed_cc_dep_spec.pb.go index aa95fb36353..ec586456eb2 100644 --- a/protos/peer/signed_cc_dep_spec.pb.go +++ b/protos/peer/signed_cc_dep_spec.pb.go @@ -30,7 +30,7 @@ type SignedChaincodeDeploymentSpec struct { func (m *SignedChaincodeDeploymentSpec) Reset() { *m = SignedChaincodeDeploymentSpec{} } func (m *SignedChaincodeDeploymentSpec) String() string { return proto.CompactTextString(m) } func (*SignedChaincodeDeploymentSpec) ProtoMessage() {} -func (*SignedChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{0} } +func (*SignedChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } func (m *SignedChaincodeDeploymentSpec) GetChaincodeDeploymentSpec() []byte { if m != nil { @@ -57,9 +57,9 @@ func init() { proto.RegisterType((*SignedChaincodeDeploymentSpec)(nil), "protos.SignedChaincodeDeploymentSpec") } -func init() { proto.RegisterFile("peer/signed_cc_dep_spec.proto", fileDescriptor10) } +func init() { proto.RegisterFile("peer/signed_cc_dep_spec.proto", fileDescriptor11) } -var fileDescriptor10 = []byte{ +var fileDescriptor11 = []byte{ // 255 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4a, 0xc3, 0x40, 0x10, 0x86, 0xa9, 0x05, 0x0f, 0xab, 0x17, 0x53, 0xc1, 0x28, 0x16, 0x4a, 0x4f, 0xf5, 0x92, 0xa0, diff --git a/protos/peer/transaction.pb.go b/protos/peer/transaction.pb.go index d232a50fbfb..7fe8173be27 100644 --- a/protos/peer/transaction.pb.go +++ b/protos/peer/transaction.pb.go @@ -102,7 +102,7 @@ var TxValidationCode_value = map[string]int32{ func (x TxValidationCode) String() string { return proto.EnumName(TxValidationCode_name, int32(x)) } -func (TxValidationCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } +func (TxValidationCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor12, []int{0} } // This message is necessary to facilitate the verification of the signature // (in the signature field) over the bytes of the transaction (in the @@ -120,7 +120,7 @@ type SignedTransaction struct { func (m *SignedTransaction) Reset() { *m = SignedTransaction{} } func (m *SignedTransaction) String() string { return proto.CompactTextString(m) } func (*SignedTransaction) ProtoMessage() {} -func (*SignedTransaction) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{0} } +func (*SignedTransaction) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{0} } func (m *SignedTransaction) GetTransactionBytes() []byte { if m != nil { @@ -152,7 +152,7 @@ type ProcessedTransaction struct { func (m *ProcessedTransaction) Reset() { *m = ProcessedTransaction{} } func (m *ProcessedTransaction) String() string { return proto.CompactTextString(m) } func (*ProcessedTransaction) ProtoMessage() {} -func (*ProcessedTransaction) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{1} } +func (*ProcessedTransaction) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{1} } func (m *ProcessedTransaction) GetTransactionEnvelope() *common.Envelope { if m != nil { @@ -189,7 +189,7 @@ type Transaction struct { func (m *Transaction) Reset() { *m = Transaction{} } func (m *Transaction) String() string { return proto.CompactTextString(m) } func (*Transaction) ProtoMessage() {} -func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{2} } +func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{2} } func (m *Transaction) GetActions() []*TransactionAction { if m != nil { @@ -211,7 +211,7 @@ type TransactionAction struct { func (m *TransactionAction) Reset() { *m = TransactionAction{} } func (m *TransactionAction) String() string { return proto.CompactTextString(m) } func (*TransactionAction) ProtoMessage() {} -func (*TransactionAction) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{3} } +func (*TransactionAction) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{3} } func (m *TransactionAction) GetHeader() []byte { if m != nil { @@ -248,7 +248,7 @@ type ChaincodeActionPayload struct { func (m *ChaincodeActionPayload) Reset() { *m = ChaincodeActionPayload{} } func (m *ChaincodeActionPayload) String() string { return proto.CompactTextString(m) } func (*ChaincodeActionPayload) ProtoMessage() {} -func (*ChaincodeActionPayload) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{4} } +func (*ChaincodeActionPayload) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{4} } func (m *ChaincodeActionPayload) GetChaincodeProposalPayload() []byte { if m != nil { @@ -279,7 +279,7 @@ type ChaincodeEndorsedAction struct { func (m *ChaincodeEndorsedAction) Reset() { *m = ChaincodeEndorsedAction{} } func (m *ChaincodeEndorsedAction) String() string { return proto.CompactTextString(m) } func (*ChaincodeEndorsedAction) ProtoMessage() {} -func (*ChaincodeEndorsedAction) Descriptor() ([]byte, []int) { return fileDescriptor11, []int{5} } +func (*ChaincodeEndorsedAction) Descriptor() ([]byte, []int) { return fileDescriptor12, []int{5} } func (m *ChaincodeEndorsedAction) GetProposalResponsePayload() []byte { if m != nil { @@ -305,9 +305,9 @@ func init() { proto.RegisterEnum("protos.TxValidationCode", TxValidationCode_name, TxValidationCode_value) } -func init() { proto.RegisterFile("peer/transaction.proto", fileDescriptor11) } +func init() { proto.RegisterFile("peer/transaction.proto", fileDescriptor12) } -var fileDescriptor11 = []byte{ +var fileDescriptor12 = []byte{ // 833 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x54, 0xd1, 0x6e, 0xe2, 0x46, 0x14, 0x2d, 0xd9, 0x4d, 0xd2, 0x0c, 0xd9, 0x64, 0x32, 0x10, 0x42, 0x50, 0xd4, 0x5d, 0xf1, 0x50,