diff --git a/configtx/application.go b/configtx/application.go index 356f814..87f4b6a 100644 --- a/configtx/application.go +++ b/configtx/application.go @@ -10,9 +10,9 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // Application is a copy of the orderer configuration with the addition of an anchor peers diff --git a/configtx/application_test.go b/configtx/application_test.go index 8b697db..549a5db 100644 --- a/configtx/application_test.go +++ b/configtx/application_test.go @@ -15,12 +15,12 @@ import ( "math/big" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/internal/policydsl" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestNewApplicationGroup(t *testing.T) { @@ -106,7 +106,7 @@ func TestNewApplicationGroup(t *testing.T) { expectedApplication := &cb.ConfigGroup{} err = protolator.DeepUnmarshalJSON(bytes.NewBufferString(expectedApplicationGroup), expectedApplication) gt.Expect(err).ToNot(HaveOccurred()) - gt.Expect(applicationGroup).To(Equal(expectedApplication)) + gt.Expect(proto.Equal(applicationGroup, expectedApplication)).To(BeTrue()) } func TestNewApplicationGroupFailure(t *testing.T) { diff --git a/configtx/capabilities.go b/configtx/capabilities.go index 0be7434..c3fbe3d 100644 --- a/configtx/capabilities.go +++ b/configtx/capabilities.go @@ -10,8 +10,8 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) // capabilitiesValue returns the config definition for a set of capabilities. diff --git a/configtx/channel.go b/configtx/channel.go index 5a8406e..924aa54 100644 --- a/configtx/channel.go +++ b/configtx/channel.go @@ -10,7 +10,7 @@ import ( "errors" "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) // ChannelGroup encapsulates the parts of the config that control channels. diff --git a/configtx/channel_test.go b/configtx/channel_test.go index 692d266..5ce2a4b 100644 --- a/configtx/channel_test.go +++ b/configtx/channel_test.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-config/protolator/protoext/commonext" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" ) diff --git a/configtx/config.go b/configtx/config.go index 261b5e1..3eea6f0 100644 --- a/configtx/config.go +++ b/configtx/config.go @@ -24,11 +24,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // Channel is a channel configuration. @@ -535,11 +534,9 @@ func newEnvelope( // channelHeader creates a ChannelHeader. func channelHeader(headerType cb.HeaderType, version int32, channelID string, epoch uint64) *cb.ChannelHeader { return &cb.ChannelHeader{ - Type: int32(headerType), - Version: version, - Timestamp: ×tamp.Timestamp{ - Seconds: ptypes.TimestampNow().GetSeconds(), - }, + Type: int32(headerType), + Version: version, + Timestamp: timestamppb.Now(), ChannelId: channelID, Epoch: epoch, } diff --git a/configtx/config_test.go b/configtx/config_test.go index 6f633fa..ac992f2 100644 --- a/configtx/config_test.go +++ b/configtx/config_test.go @@ -13,10 +13,10 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestNewConfigTx(t *testing.T) { @@ -270,7 +270,7 @@ func TestNewCreateChannelTx(t *testing.T) { expectedEnvelope.Payload, err = proto.Marshal(&expectedPayload) gt.Expect(err).NotTo(HaveOccurred()) - gt.Expect(envelope).To(Equal(&expectedEnvelope)) + gt.Expect(proto.Equal(envelope, &expectedEnvelope)).To(BeTrue()) } func TestNewCreateChannelTxFailure(t *testing.T) { diff --git a/configtx/consortiums.go b/configtx/consortiums.go index 094b8b7..e6528a4 100644 --- a/configtx/consortiums.go +++ b/configtx/consortiums.go @@ -10,9 +10,9 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // Consortium is a group of non-orderer organizations used in channel transactions. diff --git a/configtx/consortiums_test.go b/configtx/consortiums_test.go index 6d4f1c4..d5839ae 100644 --- a/configtx/consortiums_test.go +++ b/configtx/consortiums_test.go @@ -15,11 +15,11 @@ import ( "math/big" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-config/protolator/protoext/commonext" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestNewConsortiumsGroup(t *testing.T) { diff --git a/configtx/example_test.go b/configtx/example_test.go index 3bd45aa..5ba1871 100644 --- a/configtx/example_test.go +++ b/configtx/example_test.go @@ -19,15 +19,15 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx" "github.com/hyperledger/fabric-config/configtx/membership" "github.com/hyperledger/fabric-config/configtx/orderer" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" - ob "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ob "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) const ( diff --git a/configtx/internal/policydsl/policyparser.go b/configtx/internal/policydsl/policyparser.go index 4d54526..a22c09a 100644 --- a/configtx/internal/policydsl/policyparser.go +++ b/configtx/internal/policydsl/policyparser.go @@ -14,9 +14,9 @@ import ( "strings" "github.com/Knetic/govaluate" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // Gate values diff --git a/configtx/internal/policydsl/policyparser_test.go b/configtx/internal/policydsl/policyparser_test.go index 562c055..b479965 100644 --- a/configtx/internal/policydsl/policyparser_test.go +++ b/configtx/internal/policydsl/policyparser_test.go @@ -9,10 +9,10 @@ package policydsl_test import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/internal/policydsl" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" . "github.com/onsi/gomega" ) diff --git a/configtx/msp.go b/configtx/msp.go index 422c1e5..8aa5995 100644 --- a/configtx/msp.go +++ b/configtx/msp.go @@ -17,10 +17,10 @@ import ( "reflect" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/membership" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // MSP is the configuration information for a Fabric MSP. diff --git a/configtx/msp_test.go b/configtx/msp_test.go index 329128f..093d434 100644 --- a/configtx/msp_test.go +++ b/configtx/msp_test.go @@ -18,13 +18,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/membership" "github.com/hyperledger/fabric-config/configtx/orderer" "github.com/hyperledger/fabric-config/protolator" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestMSPConfigurationFailures(t *testing.T) { @@ -270,7 +270,7 @@ func TestMSPToProto(t *testing.T) { fabricMSPConfigProto, err := msp.toProto() gt.Expect(err).NotTo(HaveOccurred()) - gt.Expect(fabricMSPConfigProto).To(Equal(expectedFabricMSPConfigProto)) + gt.Expect(proto.Equal(fabricMSPConfigProto, expectedFabricMSPConfigProto)).To(BeTrue()) } func TestMSPToProtoNoNodeOUs(t *testing.T) { @@ -323,7 +323,7 @@ func TestMSPToProtoNoNodeOUs(t *testing.T) { fabricMSPConfigProto, err := msp.toProto() gt.Expect(err).NotTo(HaveOccurred()) - gt.Expect(fabricMSPConfigProto).To(Equal(expectedFabricMSPConfigProto)) + gt.Expect(proto.Equal(fabricMSPConfigProto, expectedFabricMSPConfigProto)).To(BeTrue()) } func TestParseCertificateFromBytesFailure(t *testing.T) { diff --git a/configtx/orderer.go b/configtx/orderer.go index 650e91e..a4e4b74 100644 --- a/configtx/orderer.go +++ b/configtx/orderer.go @@ -15,11 +15,11 @@ import ( "reflect" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/orderer" - cb "github.com/hyperledger/fabric-protos-go/common" - ob "github.com/hyperledger/fabric-protos-go/orderer" - eb "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ob "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + eb "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "google.golang.org/protobuf/proto" ) const ( diff --git a/configtx/orderer_test.go b/configtx/orderer_test.go index bdd12f3..5edb206 100644 --- a/configtx/orderer_test.go +++ b/configtx/orderer_test.go @@ -16,13 +16,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/orderer" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" - cb "github.com/hyperledger/fabric-protos-go/common" - ob "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ob "github.com/hyperledger/fabric-protos-go-apiv2/orderer" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestNewOrdererGroup(t *testing.T) { diff --git a/configtx/organization.go b/configtx/organization.go index c5757f0..ea5eeb4 100644 --- a/configtx/organization.go +++ b/configtx/organization.go @@ -9,10 +9,10 @@ package configtx import ( "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // newOrgConfigGroup returns an config group for an organization. diff --git a/configtx/policies.go b/configtx/policies.go index b69d21a..6df708e 100644 --- a/configtx/policies.go +++ b/configtx/policies.go @@ -12,10 +12,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/internal/policydsl" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // getPolicies returns a map of Policy from given map of ConfigPolicy in organization config group. diff --git a/configtx/policies_test.go b/configtx/policies_test.go index bb9af35..4280063 100644 --- a/configtx/policies_test.go +++ b/configtx/policies_test.go @@ -9,9 +9,9 @@ package configtx import ( "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestPolicies(t *testing.T) { diff --git a/configtx/signer.go b/configtx/signer.go index 2286301..9aa0c8a 100644 --- a/configtx/signer.go +++ b/configtx/signer.go @@ -18,9 +18,9 @@ import ( "io" "math/big" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // SigningIdentity is an MSP Identity that can be used to sign configuration diff --git a/configtx/signer_test.go b/configtx/signer_test.go index ab65112..5dba867 100644 --- a/configtx/signer_test.go +++ b/configtx/signer_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestSign(t *testing.T) { diff --git a/configtx/update.go b/configtx/update.go index 81e0dbc..c80b079 100644 --- a/configtx/update.go +++ b/configtx/update.go @@ -10,8 +10,8 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) // Compute computes the difference between two *cb.Configs and returns the diff --git a/configtx/update_test.go b/configtx/update_test.go index b2c7cde..21d2989 100644 --- a/configtx/update_test.go +++ b/configtx/update_test.go @@ -9,7 +9,9 @@ package configtx import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + "google.golang.org/protobuf/proto" + + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" ) @@ -147,7 +149,7 @@ func TestGroupPolicyModification(t *testing.T) { Groups: map[string]*cb.ConfigGroup{}, } - gt.Expect(expectedWriteSet).To(Equal(cu.WriteSet), "Mismatched write set") + gt.Expect(proto.Equal(expectedWriteSet, cu.WriteSet)).To(BeTrue(), "Mismatched write set") } func TestGroupValueModification(t *testing.T) { diff --git a/go.mod b/go.mod index 966249e..d2915eb 100644 --- a/go.mod +++ b/go.mod @@ -4,18 +4,18 @@ go 1.20 require ( github.com/Knetic/govaluate v3.0.0+incompatible - github.com/golang/protobuf v1.5.3 - github.com/hyperledger/fabric-protos-go v0.3.3 + github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 github.com/onsi/gomega v1.9.0 + google.golang.org/protobuf v1.33.0 ) require ( + github.com/golang/protobuf v1.5.3 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect + google.golang.org/grpc v1.57.0 // indirect gopkg.in/yaml.v2 v2.2.4 // indirect ) diff --git a/go.sum b/go.sum index aa83c1e..259a35f 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hyperledger/fabric-protos-go v0.3.3 h1:0nssqz8QWJNVNBVQz+IIfAd2j1ku7QPKFSM/1anKizI= -github.com/hyperledger/fabric-protos-go v0.3.3/go.mod h1:BPXse9gIOQwyAePQrwQVUcc44bTW4bB5V3tujuvyArk= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 h1:Xpd6fzG/KjAOHJsq7EQXY2l+qi/y8muxBaY7R6QWABk= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3/go.mod h1:2pq0ui6ZWA0cC8J+eCErgnMDCS1kPOEYVY+06ZAK0qE= github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= @@ -29,14 +29,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 h1:eSaPbMR4T7WfH9FvABk36NBMacoTUKdWCvV0dx+KfOg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= diff --git a/protolator/api.go b/protolator/api.go index 243691f..0cf6b08 100644 --- a/protolator/api.go +++ b/protolator/api.go @@ -7,10 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package protolator import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) -/////////////////////////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////////////////////////// // // This set of interfaces and methods is designed to allow protos to have Go methods attached // to them, so that they may be automatically marshaled to human readable JSON (where the @@ -37,7 +37,7 @@ import ( // wrapping the underlying proto message in another type which can be configured at runtime with // different contextual behavior. (See tests for examples) // -/////////////////////////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////////////////////////// // StaticallyOpaqueFieldProto should be implemented by protos which have bytes fields which // are the marshaled value of a fixed type @@ -100,7 +100,7 @@ type VariablyOpaqueSliceFieldProto interface { // VariablyOpaqueSliceFields returns the field names which contain opaque data VariablyOpaqueSliceFields() []string - // VariablyOpaqueFieldProto returns a newly allocated proto message of the correct + // VariablyOpaqueSliceFieldProto returns a newly allocated proto message of the correct // type for the field name. VariablyOpaqueSliceFieldProto(name string, index int) (proto.Message, error) } diff --git a/protolator/dynamic.go b/protolator/dynamic.go index 8a40b64..ce95884 100644 --- a/protolator/dynamic.go +++ b/protolator/dynamic.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func dynamicFrom(dynamicMsg func(underlying proto.Message) (proto.Message, error), value interface{}, destType reflect.Type) (reflect.Value, error) { diff --git a/protolator/dynamic_test.go b/protolator/dynamic_test.go index e801571..9faff79 100644 --- a/protolator/dynamic_test.go +++ b/protolator/dynamic_test.go @@ -11,7 +11,6 @@ import ( "testing" "github.com/hyperledger/fabric-config/protolator/testprotos" - . "github.com/onsi/gomega" ) diff --git a/protolator/integration/integration_test.go b/protolator/integration/integration_test.go index 1fab94a..99f27d4 100644 --- a/protolator/integration/integration_test.go +++ b/protolator/integration/integration_test.go @@ -8,15 +8,15 @@ package integration import ( "bytes" - "io/ioutil" + "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func bidirectionalMarshal(t *testing.T, doc proto.Message) { @@ -28,7 +28,7 @@ func bidirectionalMarshal(t *testing.T, doc proto.Message) { gt.Expect(err).NotTo(HaveOccurred()) newRoot := proto.Clone(doc) - newRoot.Reset() + proto.Reset(newRoot) err = protolator.DeepUnmarshalJSON(bytes.NewReader(buffer.Bytes()), newRoot) gt.Expect(err).NotTo(HaveOccurred()) @@ -46,7 +46,7 @@ func bidirectionalMarshal(t *testing.T, doc proto.Message) { func TestConfigUpdate(t *testing.T) { gt := NewGomegaWithT(t) - blockBin, err := ioutil.ReadFile("testdata/block.pb") + blockBin, err := os.ReadFile("testdata/block.pb") gt.Expect(err).NotTo(HaveOccurred()) block := &cb.Block{} @@ -85,7 +85,7 @@ func TestIdemix(t *testing.T) { func TestBlock(t *testing.T) { gt := NewGomegaWithT(t) - blockBin, err := ioutil.ReadFile("testdata/block.pb") + blockBin, err := os.ReadFile("testdata/block.pb") gt.Expect(err).NotTo(HaveOccurred()) block := &cb.Block{} @@ -134,7 +134,7 @@ func TestEmitDefaultsBug(t *testing.T) { "epoch": "0", "extension": null, "timestamp": null, - "tls_cert_hash": null, + "tls_cert_hash": "", "tx_id": "", "type": 1, "version": 0 @@ -147,7 +147,7 @@ func TestEmitDefaultsBug(t *testing.T) { ] }, "header": { - "data_hash": null, + "data_hash": "", "number": "0", "previous_hash": "Zm9v" }, @@ -299,14 +299,14 @@ func TestStaticMarshal(t *testing.T) { // configtxgen -channelID test -outputBlock block.pb -profile SampleSingleMSPSolo -configPath FABRICPATH/sampleconfig // configtxgen -configPath FABRICPATH/sampleconfig -inspectBlock block.pb > block.json - blockBin, err := ioutil.ReadFile("testdata/block.pb") + blockBin, err := os.ReadFile("testdata/block.pb") gt.Expect(err).NotTo(HaveOccurred()) block := &cb.Block{} err = proto.Unmarshal(blockBin, block) gt.Expect(err).NotTo(HaveOccurred()) - jsonBin, err := ioutil.ReadFile("testdata/block.json") + jsonBin, err := os.ReadFile("testdata/block.json") gt.Expect(err).NotTo(HaveOccurred()) buf := &bytes.Buffer{} diff --git a/protolator/integration/testdata/block.json b/protolator/integration/testdata/block.json index b6b27a2..be326fa 100644 --- a/protolator/integration/testdata/block.json +++ b/protolator/integration/testdata/block.json @@ -560,7 +560,7 @@ "epoch": "0", "extension": null, "timestamp": "2019-04-21T19:35:42Z", - "tls_cert_hash": null, + "tls_cert_hash": "", "tx_id": "7c179b7100bb0c0b33dad5114f0294e2509e9be9fbfa0ac9d38b43703ea57138", "type": 1, "version": 1 @@ -571,14 +571,14 @@ } } }, - "signature": null + "signature": "" } ] }, "header": { "data_hash": "idkpZn9B0jX9nL0kASTuPnA1PJDeXToBquHOas7f3Kk=", "number": "0", - "previous_hash": null + "previous_hash": "" }, "metadata": { "metadata": [ diff --git a/protolator/json.go b/protolator/json.go index e4b6d61..27af807 100644 --- a/protolator/json.go +++ b/protolator/json.go @@ -11,12 +11,12 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "reflect" + "strings" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" ) // MostlyDeterministicMarshal is _NOT_ the function you are looking for. @@ -26,12 +26,9 @@ import ( // the same process wants to compare binary messages for equality without // needing to unmarshal first, but should not be used generally. func MostlyDeterministicMarshal(msg proto.Message) ([]byte, error) { - buffer := proto.NewBuffer(make([]byte, 0)) - buffer.SetDeterministic(true) - if err := buffer.Marshal(msg); err != nil { - return nil, err - } - return buffer.Bytes(), nil + return proto.MarshalOptions{ + Deterministic: true, + }.Marshal(msg) } type protoFieldFactory interface { @@ -243,18 +240,17 @@ func protoToJSON(msg proto.Message) ([]byte, error) { if reflect.ValueOf(msg).IsNil() { panic("We're nil here") } - var b bytes.Buffer - m := jsonpb.Marshaler{ - EnumsAsInts: false, - EmitDefaults: true, - Indent: " ", - OrigName: true, + m := protojson.MarshalOptions{ + UseEnumNumbers: false, + EmitUnpopulated: true, + Indent: " ", + UseProtoNames: true, } - err := m.Marshal(&b, msg) + b, err := m.Marshal(msg) if err != nil { return nil, err } - return b.Bytes(), nil + return b, nil } func mapToProto(tree map[string]interface{}, msg proto.Message) error { @@ -263,7 +259,7 @@ func mapToProto(tree map[string]interface{}, msg proto.Message) error { return err } - return jsonpb.UnmarshalString(string(jsonOut), msg) + return protojson.Unmarshal(jsonOut, msg) } // jsonToMap allocates a map[string]interface{}, unmarshals a JSON document into it @@ -315,20 +311,28 @@ func protoFields(msg proto.Message, uMsg proto.Message) ([]protoField, error) { } iResult := make([][]protoField, len(fieldFactories)) - - protoProps := proto.GetProperties(mVal.Type()) + t := mVal.Type() // TODO, this will skip oneof fields, this should be handled // correctly at some point - for _, prop := range protoProps.Prop { - fieldName := prop.OrigName - fieldValue := mVal.FieldByName(prop.Name) - fieldTypeStruct, ok := mVal.Type().FieldByName(prop.Name) + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + fieldName := f.Name + tagField := f.Tag.Get("protobuf") + for _, s := range strings.Split(tagField, ",") { + if strings.HasPrefix(s, "name=") { + fieldName = s[len("name="):] + break + } + } + + fieldValue := mVal.FieldByName(f.Name) + fieldTypeStruct, ok := mVal.Type().FieldByName(f.Name) if !ok { return nil, fmt.Errorf("programming error: proto does not have field advertised by proto package") } fieldType := fieldTypeStruct.Type - for i, factory := range fieldFactories { + for j, factory := range fieldFactories { if !factory.Handles(msg, fieldName, fieldType, fieldValue) { continue } @@ -337,7 +341,7 @@ func protoFields(msg proto.Message, uMsg proto.Message) ([]protoField, error) { if err != nil { return nil, err } - iResult[i] = append(iResult[i], field) + iResult[j] = append(iResult[j], field) break } } @@ -450,7 +454,7 @@ func recursivelyPopulateMessageFromTree(tree map[string]interface{}, msg proto.M if !ok { continue } - if err := field.PopulateFrom(specialField); err != nil { + if err = field.PopulateFrom(specialField); err != nil { return err } } @@ -461,7 +465,7 @@ func recursivelyPopulateMessageFromTree(tree map[string]interface{}, msg proto.M // DeepUnmarshalJSON takes JSON output as generated by DeepMarshalJSON and decodes it into msg // This includes re-marshaling the expanded nested elements to binary form func DeepUnmarshalJSON(r io.Reader, msg proto.Message) error { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return err } diff --git a/protolator/json_test.go b/protolator/json_test.go index 3c59a42..5de08cc 100644 --- a/protolator/json_test.go +++ b/protolator/json_test.go @@ -24,10 +24,9 @@ import ( "reflect" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/testprotos" - . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) type testProtoPlainFieldFactory struct { diff --git a/protolator/nested.go b/protolator/nested.go index 5d17ca4..babd035 100644 --- a/protolator/nested.go +++ b/protolator/nested.go @@ -19,8 +19,8 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) func nestedFrom(value interface{}, destType reflect.Type) (reflect.Value, error) { @@ -38,7 +38,7 @@ func nestedTo(value reflect.Value) (interface{}, error) { return recursivelyCreateTreeFromMessage(nMsg) } -var timestampType = reflect.TypeOf(×tamp.Timestamp{}) +var timestampType = reflect.TypeOf(×tamppb.Timestamp{}) type nestedFieldFactory struct{} diff --git a/protolator/protoext/commonext/common.go b/protolator/protoext/commonext/common.go index 908b92c..c14750b 100644 --- a/protolator/protoext/commonext/common.go +++ b/protolator/protoext/commonext/common.go @@ -9,10 +9,10 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type Envelope struct{ *common.Envelope } diff --git a/protolator/protoext/commonext/common_test.go b/protolator/protoext/commonext/common_test.go index 31e0d1d..02b3f3b 100644 --- a/protolator/protoext/commonext/common_test.go +++ b/protolator/protoext/commonext/common_test.go @@ -9,10 +9,9 @@ package commonext import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - + "github.com/hyperledger/fabric-protos-go-apiv2/common" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestCommonProtolator(t *testing.T) { diff --git a/protolator/protoext/commonext/configtx.go b/protolator/protoext/commonext/configtx.go index 841415c..6745eea 100644 --- a/protolator/protoext/commonext/configtx.go +++ b/protolator/protoext/commonext/configtx.go @@ -9,8 +9,8 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) type ConfigUpdateEnvelope struct{ *common.ConfigUpdateEnvelope } @@ -70,7 +70,7 @@ func (c *Config) DynamicFieldProto(name string, base proto.Message) (proto.Messa return &DynamicChannelGroup{ConfigGroup: cg}, nil } -// ConfigUpdateIsolatedDataTypes allows other proto packages to register types for the +// ConfigUpdateIsolatedDataTypes allows other proto packages to register types for // the isolated_data field. This is necessary to break import cycles. var ConfigUpdateIsolatedDataTypes = map[string]func(string) proto.Message{} diff --git a/protolator/protoext/commonext/configuration.go b/protolator/protoext/commonext/configuration.go index f11f860..10dd16d 100644 --- a/protolator/protoext/commonext/configuration.go +++ b/protolator/protoext/commonext/configuration.go @@ -9,11 +9,11 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type DynamicChannelGroup struct { diff --git a/protolator/protoext/commonext/policies.go b/protolator/protoext/commonext/policies.go index 5cbbd30..6ff1984 100644 --- a/protolator/protoext/commonext/policies.go +++ b/protolator/protoext/commonext/policies.go @@ -9,8 +9,8 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) type Policy struct{ *common.Policy } diff --git a/protolator/protoext/decorate.go b/protolator/protoext/decorate.go index a59565b..7815072 100644 --- a/protolator/protoext/decorate.go +++ b/protolator/protoext/decorate.go @@ -7,17 +7,17 @@ SPDX-License-Identifier: Apache-2.0 package protoext import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext/commonext" "github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext" "github.com/hyperledger/fabric-config/protolator/protoext/mspext" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // Docorate will add additional capabilities to some protobuf messages that diff --git a/protolator/protoext/decorate_test.go b/protolator/protoext/decorate_test.go index 7eec178..e1bf11e 100644 --- a/protolator/protoext/decorate_test.go +++ b/protolator/protoext/decorate_test.go @@ -9,24 +9,24 @@ package protoext import ( "testing" - "github.com/golang/protobuf/proto" + "github.com/hyperledger/fabric-config/protolator/testprotos" "github.com/hyperledger/fabric-config/protolator/protoext/commonext" "github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext" "github.com/hyperledger/fabric-config/protolator/protoext/mspext" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" - + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) type GenericProtoMessage struct { - GenericField string + *testprotos.SimpleMsg } func (g *GenericProtoMessage) Reset() { @@ -293,10 +293,14 @@ func TestDecorate(t *testing.T) { { testSpec: "default", msg: &GenericProtoMessage{ - GenericField: "test", + SimpleMsg: &testprotos.SimpleMsg{ + PlainField: "test", + }, }, expectedReturn: &GenericProtoMessage{ - GenericField: "test", + SimpleMsg: &testprotos.SimpleMsg{ + PlainField: "test", + }, }, }, } diff --git a/protolator/protoext/ledger/rwsetext/rwset.go b/protolator/protoext/ledger/rwsetext/rwset.go index 9a578e8..f70f2c0 100644 --- a/protolator/protoext/ledger/rwsetext/rwset.go +++ b/protolator/protoext/ledger/rwsetext/rwset.go @@ -9,9 +9,9 @@ package rwsetext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "google.golang.org/protobuf/proto" ) type TxReadWriteSet struct{ *rwset.TxReadWriteSet } diff --git a/protolator/protoext/mspext/msp_config.go b/protolator/protoext/mspext/msp_config.go index 8fbc7be..2bbe661 100644 --- a/protolator/protoext/mspext/msp_config.go +++ b/protolator/protoext/mspext/msp_config.go @@ -9,8 +9,8 @@ package mspext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type MSPConfig struct{ *msp.MSPConfig } diff --git a/protolator/protoext/mspext/msp_principal.go b/protolator/protoext/mspext/msp_principal.go index f8c45f5..43cb1d2 100644 --- a/protolator/protoext/mspext/msp_principal.go +++ b/protolator/protoext/mspext/msp_principal.go @@ -9,8 +9,8 @@ package mspext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type MSPPrincipal struct{ *msp.MSPPrincipal } diff --git a/protolator/protoext/ordererext/configuration.go b/protolator/protoext/ordererext/configuration.go index 6c47350..4aa21d3 100644 --- a/protolator/protoext/ordererext/configuration.go +++ b/protolator/protoext/ordererext/configuration.go @@ -9,14 +9,13 @@ package ordererext import ( "fmt" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" - - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/empty" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/emptypb" ) type DynamicOrdererGroup struct { @@ -85,7 +84,7 @@ func (ct *ConsensusType) VariablyOpaqueFieldProto(name string) (proto.Message, e case "BFT": return &smartbft.Options{}, nil default: - return &empty.Empty{}, nil + return &emptypb.Empty{}, nil } } diff --git a/protolator/protoext/peerext/configuration.go b/protolator/protoext/peerext/configuration.go index a9adc92..a7b09e1 100644 --- a/protolator/protoext/peerext/configuration.go +++ b/protolator/protoext/peerext/configuration.go @@ -9,10 +9,10 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type DynamicApplicationGroup struct { diff --git a/protolator/protoext/peerext/proposal.go b/protolator/protoext/peerext/proposal.go index ba79d3b..e9ca481 100644 --- a/protolator/protoext/peerext/proposal.go +++ b/protolator/protoext/peerext/proposal.go @@ -9,9 +9,9 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type ChaincodeProposalPayload struct { diff --git a/protolator/protoext/peerext/proposal_response.go b/protolator/protoext/peerext/proposal_response.go index 508284f..0eb859a 100644 --- a/protolator/protoext/peerext/proposal_response.go +++ b/protolator/protoext/peerext/proposal_response.go @@ -9,8 +9,8 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type ProposalResponsePayload struct { diff --git a/protolator/protoext/peerext/transaction.go b/protolator/protoext/peerext/transaction.go index 552d9b3..3870811 100644 --- a/protolator/protoext/peerext/transaction.go +++ b/protolator/protoext/peerext/transaction.go @@ -9,9 +9,9 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type TransactionAction struct { // nothing was testing this diff --git a/protolator/statically_opaque.go b/protolator/statically_opaque.go index 7e6ad81..b5b2e5c 100644 --- a/protolator/statically_opaque.go +++ b/protolator/statically_opaque.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func opaqueFrom(opaqueType func() (proto.Message, error), value interface{}, destType reflect.Type) (reflect.Value, error) { diff --git a/protolator/statically_opaque_test.go b/protolator/statically_opaque_test.go index 5686934..0e7aead 100644 --- a/protolator/statically_opaque_test.go +++ b/protolator/statically_opaque_test.go @@ -10,8 +10,8 @@ import ( "bytes" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/testprotos" + "google.golang.org/protobuf/proto" . "github.com/onsi/gomega" ) diff --git a/protolator/testprotos/sample.go b/protolator/testprotos/sample.go index 8a4ec05..8c208ec 100644 --- a/protolator/testprotos/sample.go +++ b/protolator/testprotos/sample.go @@ -19,7 +19,7 @@ package testprotos import ( "fmt" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func (som *StaticallyOpaqueMsg) StaticallyOpaqueFields() []string { diff --git a/protolator/testprotos/sample.pb.go b/protolator/testprotos/sample.pb.go index db5aff5..7916a2b 100644 --- a/protolator/testprotos/sample.pb.go +++ b/protolator/testprotos/sample.pb.go @@ -1,135 +1,165 @@ +// +//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. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: sample.proto package testprotos import ( - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // SimpleMsg is designed to test that all three types of message fields, plain, map, // and slice are handled by the protolator tool type SimpleMsg struct { - PlainField string `protobuf:"bytes,1,opt,name=plain_field,json=plainField,proto3" json:"plain_field,omitempty"` - MapField map[string]string `protobuf:"bytes,2,rep,name=map_field,json=mapField,proto3" json:"map_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceField []string `protobuf:"bytes,3,rep,name=slice_field,json=sliceField,proto3" json:"slice_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SimpleMsg) Reset() { *m = SimpleMsg{} } -func (m *SimpleMsg) String() string { return proto.CompactTextString(m) } -func (*SimpleMsg) ProtoMessage() {} -func (*SimpleMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{0} + PlainField string `protobuf:"bytes,1,opt,name=plain_field,json=plainField,proto3" json:"plain_field,omitempty"` + MapField map[string]string `protobuf:"bytes,2,rep,name=map_field,json=mapField,proto3" json:"map_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceField []string `protobuf:"bytes,3,rep,name=slice_field,json=sliceField,proto3" json:"slice_field,omitempty"` } -func (m *SimpleMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SimpleMsg.Unmarshal(m, b) -} -func (m *SimpleMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SimpleMsg.Marshal(b, m, deterministic) -} -func (m *SimpleMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleMsg.Merge(m, src) +func (x *SimpleMsg) Reset() { + *x = SimpleMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SimpleMsg) XXX_Size() int { - return xxx_messageInfo_SimpleMsg.Size(m) + +func (x *SimpleMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SimpleMsg) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleMsg.DiscardUnknown(m) + +func (*SimpleMsg) ProtoMessage() {} + +func (x *SimpleMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SimpleMsg proto.InternalMessageInfo +// Deprecated: Use SimpleMsg.ProtoReflect.Descriptor instead. +func (*SimpleMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{0} +} -func (m *SimpleMsg) GetPlainField() string { - if m != nil { - return m.PlainField +func (x *SimpleMsg) GetPlainField() string { + if x != nil { + return x.PlainField } return "" } -func (m *SimpleMsg) GetMapField() map[string]string { - if m != nil { - return m.MapField +func (x *SimpleMsg) GetMapField() map[string]string { + if x != nil { + return x.MapField } return nil } -func (m *SimpleMsg) GetSliceField() []string { - if m != nil { - return m.SliceField +func (x *SimpleMsg) GetSliceField() []string { + if x != nil { + return x.SliceField } return nil } // NestedMsg is designed to test the nested message component type NestedMsg struct { - PlainNestedField *SimpleMsg `protobuf:"bytes,1,opt,name=plain_nested_field,json=plainNestedField,proto3" json:"plain_nested_field,omitempty"` - MapNestedField map[string]*SimpleMsg `protobuf:"bytes,2,rep,name=map_nested_field,json=mapNestedField,proto3" json:"map_nested_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceNestedField []*SimpleMsg `protobuf:"bytes,3,rep,name=slice_nested_field,json=sliceNestedField,proto3" json:"slice_nested_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NestedMsg) Reset() { *m = NestedMsg{} } -func (m *NestedMsg) String() string { return proto.CompactTextString(m) } -func (*NestedMsg) ProtoMessage() {} -func (*NestedMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{1} + PlainNestedField *SimpleMsg `protobuf:"bytes,1,opt,name=plain_nested_field,json=plainNestedField,proto3" json:"plain_nested_field,omitempty"` + MapNestedField map[string]*SimpleMsg `protobuf:"bytes,2,rep,name=map_nested_field,json=mapNestedField,proto3" json:"map_nested_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceNestedField []*SimpleMsg `protobuf:"bytes,3,rep,name=slice_nested_field,json=sliceNestedField,proto3" json:"slice_nested_field,omitempty"` } -func (m *NestedMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NestedMsg.Unmarshal(m, b) -} -func (m *NestedMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NestedMsg.Marshal(b, m, deterministic) -} -func (m *NestedMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_NestedMsg.Merge(m, src) +func (x *NestedMsg) Reset() { + *x = NestedMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NestedMsg) XXX_Size() int { - return xxx_messageInfo_NestedMsg.Size(m) + +func (x *NestedMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NestedMsg) XXX_DiscardUnknown() { - xxx_messageInfo_NestedMsg.DiscardUnknown(m) + +func (*NestedMsg) ProtoMessage() {} + +func (x *NestedMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NestedMsg proto.InternalMessageInfo +// Deprecated: Use NestedMsg.ProtoReflect.Descriptor instead. +func (*NestedMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{1} +} -func (m *NestedMsg) GetPlainNestedField() *SimpleMsg { - if m != nil { - return m.PlainNestedField +func (x *NestedMsg) GetPlainNestedField() *SimpleMsg { + if x != nil { + return x.PlainNestedField } return nil } -func (m *NestedMsg) GetMapNestedField() map[string]*SimpleMsg { - if m != nil { - return m.MapNestedField +func (x *NestedMsg) GetMapNestedField() map[string]*SimpleMsg { + if x != nil { + return x.MapNestedField } return nil } -func (m *NestedMsg) GetSliceNestedField() []*SimpleMsg { - if m != nil { - return m.SliceNestedField +func (x *NestedMsg) GetSliceNestedField() []*SimpleMsg { + if x != nil { + return x.SliceNestedField } return nil } @@ -137,56 +167,64 @@ func (m *NestedMsg) GetSliceNestedField() []*SimpleMsg { // StaticallyOpaqueMsg is designed to test the statically opaque message component // All fields are statically marshaled to the NestedMsg type type StaticallyOpaqueMsg struct { - PlainOpaqueField []byte `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` - MapOpaqueField map[string][]byte `protobuf:"bytes,2,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceOpaqueField [][]byte `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *StaticallyOpaqueMsg) Reset() { *m = StaticallyOpaqueMsg{} } -func (m *StaticallyOpaqueMsg) String() string { return proto.CompactTextString(m) } -func (*StaticallyOpaqueMsg) ProtoMessage() {} -func (*StaticallyOpaqueMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{2} + PlainOpaqueField []byte `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` + MapOpaqueField map[string][]byte `protobuf:"bytes,2,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceOpaqueField [][]byte `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` } -func (m *StaticallyOpaqueMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StaticallyOpaqueMsg.Unmarshal(m, b) -} -func (m *StaticallyOpaqueMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StaticallyOpaqueMsg.Marshal(b, m, deterministic) -} -func (m *StaticallyOpaqueMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_StaticallyOpaqueMsg.Merge(m, src) +func (x *StaticallyOpaqueMsg) Reset() { + *x = StaticallyOpaqueMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *StaticallyOpaqueMsg) XXX_Size() int { - return xxx_messageInfo_StaticallyOpaqueMsg.Size(m) + +func (x *StaticallyOpaqueMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StaticallyOpaqueMsg) XXX_DiscardUnknown() { - xxx_messageInfo_StaticallyOpaqueMsg.DiscardUnknown(m) + +func (*StaticallyOpaqueMsg) ProtoMessage() {} + +func (x *StaticallyOpaqueMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_StaticallyOpaqueMsg proto.InternalMessageInfo +// Deprecated: Use StaticallyOpaqueMsg.ProtoReflect.Descriptor instead. +func (*StaticallyOpaqueMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{2} +} -func (m *StaticallyOpaqueMsg) GetPlainOpaqueField() []byte { - if m != nil { - return m.PlainOpaqueField +func (x *StaticallyOpaqueMsg) GetPlainOpaqueField() []byte { + if x != nil { + return x.PlainOpaqueField } return nil } -func (m *StaticallyOpaqueMsg) GetMapOpaqueField() map[string][]byte { - if m != nil { - return m.MapOpaqueField +func (x *StaticallyOpaqueMsg) GetMapOpaqueField() map[string][]byte { + if x != nil { + return x.MapOpaqueField } return nil } -func (m *StaticallyOpaqueMsg) GetSliceOpaqueField() [][]byte { - if m != nil { - return m.SliceOpaqueField +func (x *StaticallyOpaqueMsg) GetSliceOpaqueField() [][]byte { + if x != nil { + return x.SliceOpaqueField } return nil } @@ -194,64 +232,72 @@ func (m *StaticallyOpaqueMsg) GetSliceOpaqueField() [][]byte { // VariablyOpaqueMsg is designed to test the staticaly opaque message component // The opaque type is determined by opaque_type type VariablyOpaqueMsg struct { - OpaqueType string `protobuf:"bytes,1,opt,name=opaque_type,json=opaqueType,proto3" json:"opaque_type,omitempty"` - PlainOpaqueField []byte `protobuf:"bytes,2,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` - MapOpaqueField map[string][]byte `protobuf:"bytes,3,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceOpaqueField [][]byte `protobuf:"bytes,4,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VariablyOpaqueMsg) Reset() { *m = VariablyOpaqueMsg{} } -func (m *VariablyOpaqueMsg) String() string { return proto.CompactTextString(m) } -func (*VariablyOpaqueMsg) ProtoMessage() {} -func (*VariablyOpaqueMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{3} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpaqueType string `protobuf:"bytes,1,opt,name=opaque_type,json=opaqueType,proto3" json:"opaque_type,omitempty"` + PlainOpaqueField []byte `protobuf:"bytes,2,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` + MapOpaqueField map[string][]byte `protobuf:"bytes,3,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceOpaqueField [][]byte `protobuf:"bytes,4,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` +} + +func (x *VariablyOpaqueMsg) Reset() { + *x = VariablyOpaqueMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VariablyOpaqueMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VariablyOpaqueMsg.Unmarshal(m, b) -} -func (m *VariablyOpaqueMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VariablyOpaqueMsg.Marshal(b, m, deterministic) -} -func (m *VariablyOpaqueMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_VariablyOpaqueMsg.Merge(m, src) -} -func (m *VariablyOpaqueMsg) XXX_Size() int { - return xxx_messageInfo_VariablyOpaqueMsg.Size(m) +func (x *VariablyOpaqueMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VariablyOpaqueMsg) XXX_DiscardUnknown() { - xxx_messageInfo_VariablyOpaqueMsg.DiscardUnknown(m) + +func (*VariablyOpaqueMsg) ProtoMessage() {} + +func (x *VariablyOpaqueMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VariablyOpaqueMsg proto.InternalMessageInfo +// Deprecated: Use VariablyOpaqueMsg.ProtoReflect.Descriptor instead. +func (*VariablyOpaqueMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{3} +} -func (m *VariablyOpaqueMsg) GetOpaqueType() string { - if m != nil { - return m.OpaqueType +func (x *VariablyOpaqueMsg) GetOpaqueType() string { + if x != nil { + return x.OpaqueType } return "" } -func (m *VariablyOpaqueMsg) GetPlainOpaqueField() []byte { - if m != nil { - return m.PlainOpaqueField +func (x *VariablyOpaqueMsg) GetPlainOpaqueField() []byte { + if x != nil { + return x.PlainOpaqueField } return nil } -func (m *VariablyOpaqueMsg) GetMapOpaqueField() map[string][]byte { - if m != nil { - return m.MapOpaqueField +func (x *VariablyOpaqueMsg) GetMapOpaqueField() map[string][]byte { + if x != nil { + return x.MapOpaqueField } return nil } -func (m *VariablyOpaqueMsg) GetSliceOpaqueField() [][]byte { - if m != nil { - return m.SliceOpaqueField +func (x *VariablyOpaqueMsg) GetSliceOpaqueField() [][]byte { + if x != nil { + return x.SliceOpaqueField } return nil } @@ -260,64 +306,72 @@ func (m *VariablyOpaqueMsg) GetSliceOpaqueField() [][]byte { // The dynamic wrapper applied to ContextlessMsg is determined by // dynamic_type type DynamicMsg struct { - DynamicType string `protobuf:"bytes,1,opt,name=dynamic_type,json=dynamicType,proto3" json:"dynamic_type,omitempty"` - PlainDynamicField *ContextlessMsg `protobuf:"bytes,2,opt,name=plain_dynamic_field,json=plainDynamicField,proto3" json:"plain_dynamic_field,omitempty"` - MapDynamicField map[string]*ContextlessMsg `protobuf:"bytes,3,rep,name=map_dynamic_field,json=mapDynamicField,proto3" json:"map_dynamic_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceDynamicField []*ContextlessMsg `protobuf:"bytes,4,rep,name=slice_dynamic_field,json=sliceDynamicField,proto3" json:"slice_dynamic_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DynamicMsg) Reset() { *m = DynamicMsg{} } -func (m *DynamicMsg) String() string { return proto.CompactTextString(m) } -func (*DynamicMsg) ProtoMessage() {} -func (*DynamicMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{4} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DynamicType string `protobuf:"bytes,1,opt,name=dynamic_type,json=dynamicType,proto3" json:"dynamic_type,omitempty"` + PlainDynamicField *ContextlessMsg `protobuf:"bytes,2,opt,name=plain_dynamic_field,json=plainDynamicField,proto3" json:"plain_dynamic_field,omitempty"` + MapDynamicField map[string]*ContextlessMsg `protobuf:"bytes,3,rep,name=map_dynamic_field,json=mapDynamicField,proto3" json:"map_dynamic_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceDynamicField []*ContextlessMsg `protobuf:"bytes,4,rep,name=slice_dynamic_field,json=sliceDynamicField,proto3" json:"slice_dynamic_field,omitempty"` +} + +func (x *DynamicMsg) Reset() { + *x = DynamicMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DynamicMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DynamicMsg.Unmarshal(m, b) -} -func (m *DynamicMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DynamicMsg.Marshal(b, m, deterministic) -} -func (m *DynamicMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_DynamicMsg.Merge(m, src) +func (x *DynamicMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DynamicMsg) XXX_Size() int { - return xxx_messageInfo_DynamicMsg.Size(m) -} -func (m *DynamicMsg) XXX_DiscardUnknown() { - xxx_messageInfo_DynamicMsg.DiscardUnknown(m) + +func (*DynamicMsg) ProtoMessage() {} + +func (x *DynamicMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DynamicMsg proto.InternalMessageInfo +// Deprecated: Use DynamicMsg.ProtoReflect.Descriptor instead. +func (*DynamicMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{4} +} -func (m *DynamicMsg) GetDynamicType() string { - if m != nil { - return m.DynamicType +func (x *DynamicMsg) GetDynamicType() string { + if x != nil { + return x.DynamicType } return "" } -func (m *DynamicMsg) GetPlainDynamicField() *ContextlessMsg { - if m != nil { - return m.PlainDynamicField +func (x *DynamicMsg) GetPlainDynamicField() *ContextlessMsg { + if x != nil { + return x.PlainDynamicField } return nil } -func (m *DynamicMsg) GetMapDynamicField() map[string]*ContextlessMsg { - if m != nil { - return m.MapDynamicField +func (x *DynamicMsg) GetMapDynamicField() map[string]*ContextlessMsg { + if x != nil { + return x.MapDynamicField } return nil } -func (m *DynamicMsg) GetSliceDynamicField() []*ContextlessMsg { - if m != nil { - return m.SliceDynamicField +func (x *DynamicMsg) GetSliceDynamicField() []*ContextlessMsg { + if x != nil { + return x.SliceDynamicField } return nil } @@ -326,40 +380,48 @@ func (m *DynamicMsg) GetSliceDynamicField() []*ContextlessMsg { // Because there is no context for the type embedded in the message, the opaque // type must be dynamically added at runtime type ContextlessMsg struct { - OpaqueField []byte `protobuf:"bytes,1,opt,name=opaque_field,json=opaqueField,proto3" json:"opaque_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ContextlessMsg) Reset() { *m = ContextlessMsg{} } -func (m *ContextlessMsg) String() string { return proto.CompactTextString(m) } -func (*ContextlessMsg) ProtoMessage() {} -func (*ContextlessMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{5} + OpaqueField []byte `protobuf:"bytes,1,opt,name=opaque_field,json=opaqueField,proto3" json:"opaque_field,omitempty"` } -func (m *ContextlessMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContextlessMsg.Unmarshal(m, b) -} -func (m *ContextlessMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContextlessMsg.Marshal(b, m, deterministic) -} -func (m *ContextlessMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContextlessMsg.Merge(m, src) +func (x *ContextlessMsg) Reset() { + *x = ContextlessMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ContextlessMsg) XXX_Size() int { - return xxx_messageInfo_ContextlessMsg.Size(m) + +func (x *ContextlessMsg) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ContextlessMsg) XXX_DiscardUnknown() { - xxx_messageInfo_ContextlessMsg.DiscardUnknown(m) + +func (*ContextlessMsg) ProtoMessage() {} + +func (x *ContextlessMsg) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ContextlessMsg proto.InternalMessageInfo +// Deprecated: Use ContextlessMsg.ProtoReflect.Descriptor instead. +func (*ContextlessMsg) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{5} +} -func (m *ContextlessMsg) GetOpaqueField() []byte { - if m != nil { - return m.OpaqueField +func (x *ContextlessMsg) GetOpaqueField() []byte { + if x != nil { + return x.OpaqueField } return nil } @@ -367,117 +429,350 @@ func (m *ContextlessMsg) GetOpaqueField() []byte { // UnmarshalableDeepFields contains fields which are defined to be opaque, but will // return an error if they are asked to be deserialized. type UnmarshalableDeepFields struct { - PlainOpaqueField []byte `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` - MapOpaqueField map[string][]byte `protobuf:"bytes,2,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SliceOpaqueField [][]byte `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *UnmarshalableDeepFields) Reset() { *m = UnmarshalableDeepFields{} } -func (m *UnmarshalableDeepFields) String() string { return proto.CompactTextString(m) } -func (*UnmarshalableDeepFields) ProtoMessage() {} -func (*UnmarshalableDeepFields) Descriptor() ([]byte, []int) { - return fileDescriptor_2141552de9bf11d0, []int{6} + PlainOpaqueField []byte `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"` + MapOpaqueField map[string][]byte `protobuf:"bytes,2,rep,name=map_opaque_field,json=mapOpaqueField,proto3" json:"map_opaque_field,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SliceOpaqueField [][]byte `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"` } -func (m *UnmarshalableDeepFields) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UnmarshalableDeepFields.Unmarshal(m, b) -} -func (m *UnmarshalableDeepFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UnmarshalableDeepFields.Marshal(b, m, deterministic) -} -func (m *UnmarshalableDeepFields) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnmarshalableDeepFields.Merge(m, src) +func (x *UnmarshalableDeepFields) Reset() { + *x = UnmarshalableDeepFields{} + if protoimpl.UnsafeEnabled { + mi := &file_sample_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *UnmarshalableDeepFields) XXX_Size() int { - return xxx_messageInfo_UnmarshalableDeepFields.Size(m) + +func (x *UnmarshalableDeepFields) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *UnmarshalableDeepFields) XXX_DiscardUnknown() { - xxx_messageInfo_UnmarshalableDeepFields.DiscardUnknown(m) + +func (*UnmarshalableDeepFields) ProtoMessage() {} + +func (x *UnmarshalableDeepFields) ProtoReflect() protoreflect.Message { + mi := &file_sample_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_UnmarshalableDeepFields proto.InternalMessageInfo +// Deprecated: Use UnmarshalableDeepFields.ProtoReflect.Descriptor instead. +func (*UnmarshalableDeepFields) Descriptor() ([]byte, []int) { + return file_sample_proto_rawDescGZIP(), []int{6} +} -func (m *UnmarshalableDeepFields) GetPlainOpaqueField() []byte { - if m != nil { - return m.PlainOpaqueField +func (x *UnmarshalableDeepFields) GetPlainOpaqueField() []byte { + if x != nil { + return x.PlainOpaqueField } return nil } -func (m *UnmarshalableDeepFields) GetMapOpaqueField() map[string][]byte { - if m != nil { - return m.MapOpaqueField +func (x *UnmarshalableDeepFields) GetMapOpaqueField() map[string][]byte { + if x != nil { + return x.MapOpaqueField } return nil } -func (m *UnmarshalableDeepFields) GetSliceOpaqueField() [][]byte { - if m != nil { - return m.SliceOpaqueField +func (x *UnmarshalableDeepFields) GetSliceOpaqueField() [][]byte { + if x != nil { + return x.SliceOpaqueField } return nil } -func init() { - proto.RegisterType((*SimpleMsg)(nil), "testprotos.SimpleMsg") - proto.RegisterMapType((map[string]string)(nil), "testprotos.SimpleMsg.MapFieldEntry") - proto.RegisterType((*NestedMsg)(nil), "testprotos.NestedMsg") - proto.RegisterMapType((map[string]*SimpleMsg)(nil), "testprotos.NestedMsg.MapNestedFieldEntry") - proto.RegisterType((*StaticallyOpaqueMsg)(nil), "testprotos.StaticallyOpaqueMsg") - proto.RegisterMapType((map[string][]byte)(nil), "testprotos.StaticallyOpaqueMsg.MapOpaqueFieldEntry") - proto.RegisterType((*VariablyOpaqueMsg)(nil), "testprotos.VariablyOpaqueMsg") - proto.RegisterMapType((map[string][]byte)(nil), "testprotos.VariablyOpaqueMsg.MapOpaqueFieldEntry") - proto.RegisterType((*DynamicMsg)(nil), "testprotos.DynamicMsg") - proto.RegisterMapType((map[string]*ContextlessMsg)(nil), "testprotos.DynamicMsg.MapDynamicFieldEntry") - proto.RegisterType((*ContextlessMsg)(nil), "testprotos.ContextlessMsg") - proto.RegisterType((*UnmarshalableDeepFields)(nil), "testprotos.UnmarshalableDeepFields") - proto.RegisterMapType((map[string][]byte)(nil), "testprotos.UnmarshalableDeepFields.MapOpaqueFieldEntry") -} - -func init() { proto.RegisterFile("sample.proto", fileDescriptor_2141552de9bf11d0) } - -var fileDescriptor_2141552de9bf11d0 = []byte{ - // 617 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x86, 0x15, 0xbb, 0x20, 0x72, 0x1c, 0x4a, 0xe2, 0x14, 0x51, 0x65, 0xd3, 0x10, 0x36, 0x45, - 0xad, 0x62, 0x48, 0x16, 0x20, 0xd8, 0x94, 0xb6, 0xb0, 0x40, 0x2a, 0x48, 0x09, 0x37, 0x81, 0x00, - 0x4d, 0x9c, 0x69, 0x62, 0x31, 0xbe, 0xe0, 0x99, 0x20, 0xbc, 0xe3, 0x1d, 0x58, 0xf2, 0x12, 0x3c, - 0x04, 0x4b, 0x1e, 0x0a, 0xcd, 0x25, 0xcd, 0x19, 0x6a, 0x17, 0x21, 0x84, 0xd4, 0x55, 0xe2, 0xe3, - 0x39, 0xff, 0xf9, 0xff, 0xcf, 0x33, 0x03, 0x0d, 0x4e, 0xe2, 0x8c, 0xd1, 0x7e, 0x96, 0xa7, 0x22, - 0xf5, 0x41, 0x50, 0x2e, 0xd4, 0x5f, 0xde, 0xfb, 0x59, 0x83, 0xfa, 0x38, 0x92, 0x2f, 0x8f, 0xf8, - 0xcc, 0xdf, 0x02, 0x2f, 0x63, 0x24, 0x4a, 0xde, 0x1f, 0x47, 0x94, 0x4d, 0x37, 0x6b, 0xdd, 0xda, - 0x76, 0x7d, 0x04, 0xaa, 0xf4, 0x48, 0x56, 0xfc, 0x3d, 0xa8, 0xc7, 0x24, 0x33, 0xaf, 0x9d, 0xae, - 0xbb, 0xed, 0x0d, 0x6e, 0xf4, 0x57, 0x72, 0xfd, 0x13, 0xa9, 0xfe, 0x11, 0xc9, 0x54, 0xcb, 0xc3, - 0x44, 0xe4, 0xc5, 0xe8, 0x52, 0x6c, 0x1e, 0xe5, 0x08, 0xce, 0xa2, 0x90, 0x1a, 0x0d, 0xb7, 0xeb, - 0xca, 0x11, 0xaa, 0xa4, 0x16, 0x74, 0xee, 0xc3, 0x65, 0xab, 0xd7, 0x6f, 0x82, 0xfb, 0x81, 0x16, - 0xc6, 0x8c, 0xfc, 0xeb, 0x6f, 0xc0, 0x85, 0x4f, 0x84, 0x2d, 0xe8, 0xa6, 0xa3, 0x6a, 0xfa, 0xe1, - 0x9e, 0x73, 0xb7, 0xd6, 0xfb, 0xe1, 0x40, 0xfd, 0x09, 0xe5, 0x82, 0x4e, 0x65, 0x9c, 0x03, 0xf0, - 0x75, 0x9c, 0x44, 0x95, 0x50, 0x2a, 0x6f, 0x70, 0xb5, 0xd4, 0xf6, 0xa8, 0xa9, 0x1a, 0xb4, 0x84, - 0x36, 0x3c, 0x86, 0xa6, 0x8c, 0x6c, 0x49, 0xe8, 0xe4, 0x37, 0xb1, 0xc4, 0xc9, 0x54, 0x99, 0x1c, - 0xf5, 0xeb, 0xfc, 0xeb, 0xb1, 0x55, 0x94, 0xce, 0x34, 0x05, 0x4b, 0xd6, 0x55, 0xb2, 0x55, 0xce, - 0x54, 0x03, 0x12, 0xe9, 0xbc, 0x82, 0x76, 0xc9, 0xac, 0x12, 0x5e, 0x3b, 0x98, 0x57, 0xe5, 0x00, - 0x84, 0xf1, 0xab, 0x03, 0xed, 0xb1, 0x20, 0x22, 0x0a, 0x09, 0x63, 0xc5, 0xd3, 0x8c, 0x7c, 0x5c, - 0xa8, 0xfd, 0xb1, 0xbb, 0x04, 0x9a, 0xaa, 0x12, 0x02, 0xda, 0x30, 0xe4, 0xf4, 0x5a, 0x1d, 0xf2, - 0xad, 0x26, 0x67, 0xad, 0xd5, 0xe4, 0x86, 0x96, 0x83, 0xd3, 0x83, 0x24, 0x43, 0xa4, 0xb4, 0x62, - 0x88, 0xe5, 0x77, 0x97, 0x0c, 0xad, 0x01, 0x92, 0x61, 0xc3, 0xc0, 0x42, 0xab, 0x3b, 0x0f, 0x14, - 0xac, 0xdf, 0x45, 0xff, 0xb4, 0xb9, 0x1a, 0x98, 0xca, 0x77, 0x07, 0x5a, 0x2f, 0x48, 0x1e, 0x91, - 0x09, 0x66, 0xb2, 0x05, 0x9e, 0x31, 0x20, 0x8a, 0x8c, 0x2e, 0xcf, 0x8c, 0x2e, 0x3d, 0x2b, 0x32, - 0x5a, 0x01, 0xcd, 0xa9, 0x80, 0xf6, 0xa6, 0x04, 0x9a, 0xde, 0x17, 0xb7, 0x31, 0xb4, 0x53, 0x3e, - 0xfe, 0x01, 0xd9, 0xda, 0xff, 0x43, 0xf6, 0xc5, 0x05, 0x38, 0x2c, 0x12, 0x12, 0x47, 0xa1, 0x64, - 0x75, 0x1d, 0x1a, 0x53, 0xfd, 0x84, 0x61, 0x79, 0xa6, 0xa6, 0x68, 0x3d, 0x86, 0xb6, 0xa6, 0xb5, - 0x5c, 0xb8, 0xc2, 0xe5, 0x0d, 0x3a, 0x18, 0xc1, 0x41, 0x9a, 0x08, 0xfa, 0x59, 0x30, 0xca, 0xb9, - 0xdc, 0xbe, 0x2d, 0xd5, 0x66, 0x86, 0xe9, 0xb8, 0x2f, 0xa1, 0x25, 0x59, 0xda, 0x4a, 0x1a, 0xe6, - 0x0e, 0x56, 0x5a, 0x39, 0x94, 0x14, 0xb1, 0x84, 0xc6, 0x78, 0x25, 0xb6, 0xab, 0xd2, 0xa4, 0xe6, - 0x68, 0x4b, 0xaf, 0x29, 0xe9, 0x33, 0x4d, 0xaa, 0x36, 0xac, 0xd5, 0x79, 0x07, 0x1b, 0x65, 0x43, - 0x4b, 0x30, 0xdf, 0xb2, 0x8f, 0xf1, 0x59, 0x73, 0xd0, 0x27, 0x18, 0xc2, 0xba, 0xfd, 0x52, 0x7e, - 0x85, 0x92, 0xf3, 0x6b, 0x76, 0xb1, 0x72, 0xd0, 0xfb, 0xe6, 0xc0, 0xb5, 0xe7, 0x49, 0x4c, 0x72, - 0x3e, 0x27, 0x8c, 0x4c, 0x18, 0x3d, 0xa4, 0x54, 0xdf, 0xc9, 0xfc, 0x2f, 0x2f, 0x01, 0x52, 0x79, - 0x09, 0xdc, 0xc1, 0xfe, 0x2b, 0x86, 0x9d, 0xcb, 0x8b, 0x60, 0x7f, 0xff, 0xf5, 0xde, 0x2c, 0x12, - 0xf3, 0xc5, 0xa4, 0x1f, 0xa6, 0x71, 0x30, 0x2f, 0x32, 0x9a, 0x33, 0x3a, 0x9d, 0xd1, 0x3c, 0x38, - 0x26, 0x93, 0x3c, 0x0a, 0x83, 0x30, 0x8d, 0xe3, 0x34, 0x09, 0x44, 0x9a, 0x32, 0x1e, 0xa8, 0x84, - 0x8c, 0x88, 0x34, 0x0f, 0x56, 0x81, 0x27, 0x17, 0xd5, 0xef, 0xf0, 0x57, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xbc, 0xe8, 0xa5, 0x47, 0x9b, 0x07, 0x00, 0x00, +var File_sample_proto protoreflect.FileDescriptor + +var file_sample_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x09, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x40, 0x0a, 0x09, 0x6d, 0x61, 0x70, + 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, + 0x4d, 0x73, 0x67, 0x2e, 0x4d, 0x61, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, + 0x6c, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0a, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x3b, 0x0a, 0x0d, + 0x4d, 0x61, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, 0x02, 0x0a, 0x09, 0x4e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x43, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x10, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x53, 0x0a, 0x10, + 0x6d, 0x61, 0x70, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x2e, 0x4d, 0x61, + 0x70, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0e, 0x6d, 0x61, 0x70, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x12, 0x43, 0x0a, 0x12, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x4d, 0x73, 0x67, 0x52, 0x10, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x58, 0x0a, 0x13, 0x4d, 0x61, 0x70, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x4d, 0x73, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x93, 0x02, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x4f, + 0x70, 0x61, 0x71, 0x75, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x70, 0x61, 0x71, 0x75, + 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x5d, 0x0a, 0x10, 0x6d, 0x61, 0x70, 0x5f, 0x6f, 0x70, + 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x4d, 0x73, + 0x67, 0x2e, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x6d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x5f, 0x6f, + 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x10, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x1a, 0x41, 0x0a, 0x13, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb0, 0x02, 0x0a, 0x11, 0x56, 0x61, 0x72, 0x69, 0x61, + 0x62, 0x6c, 0x79, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x1f, 0x0a, 0x0b, + 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, + 0x12, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x5b, 0x0a, 0x10, 0x6d, + 0x61, 0x70, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x79, 0x4f, 0x70, 0x61, 0x71, 0x75, + 0x65, 0x4d, 0x73, 0x67, 0x2e, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x6d, 0x61, 0x70, 0x4f, 0x70, 0x61, + 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x6c, 0x69, 0x63, + 0x65, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x61, 0x71, 0x75, + 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x41, 0x0a, 0x13, 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x61, + 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x80, 0x03, 0x0a, 0x0a, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x73, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x13, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x6c, 0x65, 0x73, + 0x73, 0x4d, 0x73, 0x67, 0x52, 0x11, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x57, 0x0a, 0x11, 0x6d, 0x61, 0x70, 0x5f, 0x64, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x4d, 0x73, 0x67, 0x2e, 0x4d, 0x61, 0x70, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0f, 0x6d, 0x61, 0x70, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x4a, 0x0a, 0x13, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x6c, 0x65, 0x73, 0x73, 0x4d, 0x73, 0x67, 0x52, 0x11, 0x73, 0x6c, 0x69, 0x63, 0x65, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x5e, 0x0a, 0x14, + 0x4d, 0x61, 0x70, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x6c, 0x65, 0x73, 0x73, 0x4d, 0x73, + 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x33, 0x0a, 0x0e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x6c, 0x65, 0x73, 0x73, 0x4d, 0x73, 0x67, 0x12, 0x21, + 0x0a, 0x0c, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x22, 0x9b, 0x02, 0x0a, 0x17, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x44, 0x65, 0x65, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x2c, 0x0a, + 0x12, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x61, 0x0a, 0x10, 0x6d, + 0x61, 0x70, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x44, 0x65, 0x65, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x4d, 0x61, 0x70, 0x4f, 0x70, + 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, + 0x6d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2c, + 0x0a, 0x12, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x5f, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x73, 0x6c, 0x69, 0x63, + 0x65, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0x41, 0x0a, 0x13, + 0x4d, 0x61, 0x70, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6c, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sample_proto_rawDescOnce sync.Once + file_sample_proto_rawDescData = file_sample_proto_rawDesc +) + +func file_sample_proto_rawDescGZIP() []byte { + file_sample_proto_rawDescOnce.Do(func() { + file_sample_proto_rawDescData = protoimpl.X.CompressGZIP(file_sample_proto_rawDescData) + }) + return file_sample_proto_rawDescData +} + +var file_sample_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_sample_proto_goTypes = []any{ + (*SimpleMsg)(nil), // 0: testprotos.SimpleMsg + (*NestedMsg)(nil), // 1: testprotos.NestedMsg + (*StaticallyOpaqueMsg)(nil), // 2: testprotos.StaticallyOpaqueMsg + (*VariablyOpaqueMsg)(nil), // 3: testprotos.VariablyOpaqueMsg + (*DynamicMsg)(nil), // 4: testprotos.DynamicMsg + (*ContextlessMsg)(nil), // 5: testprotos.ContextlessMsg + (*UnmarshalableDeepFields)(nil), // 6: testprotos.UnmarshalableDeepFields + nil, // 7: testprotos.SimpleMsg.MapFieldEntry + nil, // 8: testprotos.NestedMsg.MapNestedFieldEntry + nil, // 9: testprotos.StaticallyOpaqueMsg.MapOpaqueFieldEntry + nil, // 10: testprotos.VariablyOpaqueMsg.MapOpaqueFieldEntry + nil, // 11: testprotos.DynamicMsg.MapDynamicFieldEntry + nil, // 12: testprotos.UnmarshalableDeepFields.MapOpaqueFieldEntry +} +var file_sample_proto_depIdxs = []int32{ + 7, // 0: testprotos.SimpleMsg.map_field:type_name -> testprotos.SimpleMsg.MapFieldEntry + 0, // 1: testprotos.NestedMsg.plain_nested_field:type_name -> testprotos.SimpleMsg + 8, // 2: testprotos.NestedMsg.map_nested_field:type_name -> testprotos.NestedMsg.MapNestedFieldEntry + 0, // 3: testprotos.NestedMsg.slice_nested_field:type_name -> testprotos.SimpleMsg + 9, // 4: testprotos.StaticallyOpaqueMsg.map_opaque_field:type_name -> testprotos.StaticallyOpaqueMsg.MapOpaqueFieldEntry + 10, // 5: testprotos.VariablyOpaqueMsg.map_opaque_field:type_name -> testprotos.VariablyOpaqueMsg.MapOpaqueFieldEntry + 5, // 6: testprotos.DynamicMsg.plain_dynamic_field:type_name -> testprotos.ContextlessMsg + 11, // 7: testprotos.DynamicMsg.map_dynamic_field:type_name -> testprotos.DynamicMsg.MapDynamicFieldEntry + 5, // 8: testprotos.DynamicMsg.slice_dynamic_field:type_name -> testprotos.ContextlessMsg + 12, // 9: testprotos.UnmarshalableDeepFields.map_opaque_field:type_name -> testprotos.UnmarshalableDeepFields.MapOpaqueFieldEntry + 0, // 10: testprotos.NestedMsg.MapNestedFieldEntry.value:type_name -> testprotos.SimpleMsg + 5, // 11: testprotos.DynamicMsg.MapDynamicFieldEntry.value:type_name -> testprotos.ContextlessMsg + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_sample_proto_init() } +func file_sample_proto_init() { + if File_sample_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sample_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*SimpleMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*NestedMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*StaticallyOpaqueMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*VariablyOpaqueMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*DynamicMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*ContextlessMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sample_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*UnmarshalableDeepFields); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sample_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sample_proto_goTypes, + DependencyIndexes: file_sample_proto_depIdxs, + MessageInfos: file_sample_proto_msgTypes, + }.Build() + File_sample_proto = out.File + file_sample_proto_rawDesc = nil + file_sample_proto_goTypes = nil + file_sample_proto_depIdxs = nil } diff --git a/protolator/variably_opaque.go b/protolator/variably_opaque.go index f4f1e38..49e3889 100644 --- a/protolator/variably_opaque.go +++ b/protolator/variably_opaque.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) type variablyOpaqueFieldFactory struct{} diff --git a/protolator/variably_opaque_test.go b/protolator/variably_opaque_test.go index 9436830..4bbc5fa 100644 --- a/protolator/variably_opaque_test.go +++ b/protolator/variably_opaque_test.go @@ -10,8 +10,8 @@ import ( "bytes" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/testprotos" + "google.golang.org/protobuf/proto" . "github.com/onsi/gomega" )