Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit c848d11

Browse files
Update fabric-protos-go dependency (#208)
1 parent 0cfb50d commit c848d11

File tree

9 files changed

+50
-47
lines changed

9 files changed

+50
-47
lines changed

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ require (
1313
github.com/hashicorp/hcl v1.0.0 // indirect
1414
github.com/hyperledger/fabric-config v0.0.5
1515
github.com/hyperledger/fabric-lib-go v1.0.0
16-
github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23
17-
github.com/magiconair/properties v1.8.1 // indirect
16+
github.com/hyperledger/fabric-protos-go v0.0.0-20211118165945-23d738fc3553
17+
github.com/magiconair/properties v1.8.5 // indirect
1818
github.com/miekg/pkcs11 v1.0.3
1919
github.com/mitchellh/mapstructure v1.3.2
20-
github.com/pelletier/go-toml v1.8.0 // indirect
20+
github.com/pelletier/go-toml v1.9.4 // indirect
2121
github.com/pkg/errors v0.8.1
2222
github.com/prometheus/client_golang v1.3.0
23-
github.com/spf13/afero v1.3.1 // indirect
23+
github.com/spf13/afero v1.6.0 // indirect
2424
github.com/spf13/cast v1.3.1
2525
github.com/spf13/jwalterweatherman v1.1.0 // indirect
26-
github.com/spf13/pflag v1.0.5 // indirect
2726
github.com/spf13/viper v1.1.1
2827
github.com/stretchr/testify v1.5.1
2928
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d

go.sum

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
bitbucket.org/liamstask/goose v0.0.0-20150115234039-8488cc47d90c/go.mod h1:hSVuE3qU7grINVSwrmzHfpg9k87ALBk+XaualNyUzI4=
22
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
33
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
4-
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
54
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
65
github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
76
github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
@@ -152,8 +151,8 @@ github.com/hyperledger/fabric-config v0.0.5/go.mod h1:YpITBI/+ZayA3XWY5lF302K7PA
152151
github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
153152
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
154153
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
155-
github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23 h1:SEbB3yH4ISTGRifDamYXAst36gO2kM855ndMJlsv+pc=
156-
github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
154+
github.com/hyperledger/fabric-protos-go v0.0.0-20211118165945-23d738fc3553 h1:E9f0v1q4EDfrE+0LdkxVtdYKAZ7PGCaj1bBx45R9yEQ=
155+
github.com/hyperledger/fabric-protos-go v0.0.0-20211118165945-23d738fc3553/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
157156
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
158157
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
159158
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
@@ -183,8 +182,8 @@ github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTRe
183182
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
184183
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
185184
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
186-
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
187-
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
185+
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
186+
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
188187
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
189188
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
190189
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
@@ -239,8 +238,8 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh
239238
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
240239
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
241240
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
242-
github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw=
243-
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
241+
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
242+
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
244243
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
245244
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
246245
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
@@ -287,16 +286,15 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
287286
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
288287
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
289288
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
290-
github.com/spf13/afero v1.3.1 h1:GPTpEAuNr98px18yNQ66JllNil98wfRZ/5Ukny8FeQA=
291-
github.com/spf13/afero v1.3.1/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
289+
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
290+
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
292291
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
293292
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
294293
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
295294
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
296295
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
296+
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
297297
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
298-
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
299-
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
300298
github.com/spf13/viper v1.1.1 h1:/8JBRFO4eoHu1TmpsLgNBq1CQgRUg4GolYlEFieqJgo=
301299
github.com/spf13/viper v1.1.1/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
302300
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
@@ -397,8 +395,9 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk
397395
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
398396
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
399397
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
400-
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
401398
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
399+
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
400+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
402401
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
403402
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
404403
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

internal/github.com/hyperledger/fabric/discovery/client/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package discovery
1212

1313
import (
1414
"github.com/hyperledger/fabric-protos-go/discovery"
15+
"github.com/hyperledger/fabric-protos-go/peer"
1516
"github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/gossip/protoext"
1617
"github.com/pkg/errors"
1718
"google.golang.org/grpc"
@@ -44,7 +45,7 @@ type ChannelResponse interface {
4445
Config() (*discovery.ConfigResult, error)
4546

4647
// Peers returns a response for a peer membership query, or error if something went wrong
47-
Peers(invocationChain ...*discovery.ChaincodeCall) ([]*Peer, error)
48+
Peers(invocationChain ...*peer.ChaincodeCall) ([]*Peer, error)
4849

4950
// Endorsers returns the response for an endorser query for a given
5051
// chaincode in a given channel context, or error if something went wrong.

internal/github.com/hyperledger/fabric/discovery/client/client.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"github.com/golang/protobuf/proto"
2121
"github.com/hyperledger/fabric-protos-go/discovery"
2222
"github.com/hyperledger/fabric-protos-go/msp"
23+
"github.com/hyperledger/fabric-protos-go/peer"
2324
"github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/discovery/protoext"
2425
gprotoext "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/gossip/protoext"
2526
"github.com/pkg/errors"
@@ -80,7 +81,7 @@ func (req *Request) AddConfigQuery() *Request {
8081
// AddEndorsersQuery adds to the request a query for given chaincodes
8182
// interests are the chaincode interests that the client wants to query for.
8283
// All interests for a given channel should be supplied in an aggregated slice
83-
func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error) {
84+
func (req *Request) AddEndorsersQuery(interests ...*peer.ChaincodeInterest) (*Request, error) {
8485
if err := validateInterests(interests...); err != nil {
8586
return nil, err
8687
}
@@ -117,11 +118,11 @@ func (req *Request) AddLocalPeersQuery() *Request {
117118
}
118119

119120
// AddPeersQuery adds to the request a peer query
120-
func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request {
121+
func (req *Request) AddPeersQuery(invocationChain ...*peer.ChaincodeCall) *Request {
121122
ch := req.lastChannel
122123
q := &discovery.Query_PeerQuery{
123124
PeerQuery: &discovery.PeerMembershipQuery{
124-
Filter: &discovery.ChaincodeInterest{
125+
Filter: &peer.ChaincodeInterest{
125126
Chaincodes: invocationChain,
126127
},
127128
},
@@ -226,7 +227,7 @@ func (cr *channelResponse) Config() (*discovery.ConfigResult, error) {
226227
return nil, res.(error)
227228
}
228229

229-
func parsePeers(queryType protoext.QueryType, r response, channel string, invocationChain ...*discovery.ChaincodeCall) ([]*Peer, error) {
230+
func parsePeers(queryType protoext.QueryType, r response, channel string, invocationChain ...*peer.ChaincodeCall) ([]*Peer, error) {
230231
peerKeys := key{
231232
queryType: queryType,
232233
k: fmt.Sprintf("%s %s", channel, InvocationChain(invocationChain).String()),
@@ -244,7 +245,7 @@ func parsePeers(queryType protoext.QueryType, r response, channel string, invoca
244245
return nil, res.(error)
245246
}
246247

247-
func (cr *channelResponse) Peers(invocationChain ...*discovery.ChaincodeCall) ([]*Peer, error) {
248+
func (cr *channelResponse) Peers(invocationChain ...*peer.ChaincodeCall) ([]*Peer, error) {
248249
return parsePeers(protoext.PeerMembershipQueryType, cr.response, cr.channel, invocationChain...)
249250
}
250251

@@ -601,7 +602,7 @@ func validateStateInfoMessage(message *gprotoext.SignedGossipMessage) error {
601602
return nil
602603
}
603604

604-
func validateInterests(interests ...*discovery.ChaincodeInterest) error {
605+
func validateInterests(interests ...*peer.ChaincodeInterest) error {
605606
if len(interests) == 0 {
606607
return errors.New("no chaincode interests given")
607608
}
@@ -617,7 +618,7 @@ func validateInterests(interests ...*discovery.ChaincodeInterest) error {
617618
}
618619

619620
// InvocationChain aggregates ChaincodeCalls
620-
type InvocationChain []*discovery.ChaincodeCall
621+
type InvocationChain []*peer.ChaincodeCall
621622

622623
// String returns a string representation of this invocation chain
623624
func (ic InvocationChain) String() string {

pkg/client/common/selection/fabricselection/fabricselection.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/hyperledger/fabric-protos-go/discovery"
16+
"github.com/hyperledger/fabric-protos-go/peer"
1717
discclient "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/discovery/client"
1818
"github.com/hyperledger/fabric-sdk-go/pkg/client/common/random"
1919
soptions "github.com/hyperledger/fabric-sdk-go/pkg/client/common/selection/options"
@@ -300,16 +300,16 @@ func (s *Service) getTargets(ctx contextAPI.Client) ([]fab.PeerConfig, error) {
300300
return random.PickRandomNPeerConfigs(chpeers, chConfig.Policies.Discovery.MaxTargets), nil
301301
}
302302

303-
func asChaincodeInterests(chaincodes []*fab.ChaincodeCall) *discovery.ChaincodeInterest {
304-
return &discovery.ChaincodeInterest{
303+
func asChaincodeInterests(chaincodes []*fab.ChaincodeCall) *peer.ChaincodeInterest {
304+
return &peer.ChaincodeInterest{
305305
Chaincodes: asInvocationChain(chaincodes),
306306
}
307307
}
308308

309309
func asInvocationChain(chaincodes []*fab.ChaincodeCall) discclient.InvocationChain {
310310
var invocChain discclient.InvocationChain
311311
for _, cc := range chaincodes {
312-
invocChain = append(invocChain, &discovery.ChaincodeCall{
312+
invocChain = append(invocChain, &peer.ChaincodeCall{
313313
Name: cc.ID,
314314
CollectionNames: cc.Collections,
315315
})

pkg/client/common/selection/fabricselection/selectionfilter_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SPDX-License-Identifier: Apache-2.0
77
package fabricselection
88

99
import (
10+
"context"
1011
"testing"
1112

1213
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
@@ -32,7 +33,7 @@ func TestPeerEndpointValue(t *testing.T) {
3233
require.Equal(t, uint64(1001), ep.Properties()[fab.PropertyLedgerHeight])
3334
require.Equal(t, uint64(1001), ep.BlockHeight())
3435
require.Panics(t, func() {
35-
_, err := ep.ProcessTransactionProposal(nil, fab.ProcessProposalRequest{})
36+
_, err := ep.ProcessTransactionProposal(context.TODO(), fab.ProcessProposalRequest{})
3637
require.NoError(t, err)
3738
})
3839
})

pkg/fab/discovery/mockdiscoveryclient.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"github.com/hyperledger/fabric-protos-go/discovery"
1414
"github.com/hyperledger/fabric-protos-go/gossip"
15+
"github.com/hyperledger/fabric-protos-go/peer"
1516
discclient "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/discovery/client"
1617
gprotoext "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/gossip/protoext"
1718
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab"
@@ -113,7 +114,7 @@ func (cr *channelResponse) Config() (*discovery.ConfigResult, error) {
113114
}
114115

115116
// Peers returns a response for a peer membership query, or error if something went wrong
116-
func (cr *channelResponse) Peers(invocationChain ...*discovery.ChaincodeCall) ([]*discclient.Peer, error) {
117+
func (cr *channelResponse) Peers(invocationChain ...*peer.ChaincodeCall) ([]*discclient.Peer, error) {
117118
return cr.peers, cr.err
118119
}
119120

pkg/fab/discovery/request.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
77
package discovery
88

99
import (
10-
"github.com/hyperledger/fabric-protos-go/discovery"
10+
"github.com/hyperledger/fabric-protos-go/peer"
1111
discclient "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/discovery/client"
1212
)
1313

@@ -42,23 +42,23 @@ func (req *Request) OfChannel(ch string) *Request {
4242
// AddEndorsersQuery adds to the request a query for given chaincodes
4343
// interests are the chaincode interests that the client wants to query for.
4444
// All interests for a given channel should be supplied in an aggregated slice
45-
func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error) {
45+
func (req *Request) AddEndorsersQuery(interests ...*peer.ChaincodeInterest) (*Request, error) {
4646
_, err := req.r.AddEndorsersQuery(interests...)
4747
return req, err
4848
}
4949

5050
// AddPeersQuery adds to the request a peer query
51-
func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request {
51+
func (req *Request) AddPeersQuery(invocationChain ...*peer.ChaincodeCall) *Request {
5252
req.r.AddPeersQuery(invocationChain...)
5353
return req
5454
}
5555

5656
// CcCalls creates an array of ChaincodeCalls based of cc names, can be used in AddPeersQuery(CcCalls(...))
57-
func CcCalls(ccNames ...string) []*discovery.ChaincodeCall {
58-
var call []*discovery.ChaincodeCall
57+
func CcCalls(ccNames ...string) []*peer.ChaincodeCall {
58+
var call []*peer.ChaincodeCall
5959

6060
for _, ccName := range ccNames {
61-
call = append(call, &discovery.ChaincodeCall{
61+
call = append(call, &peer.ChaincodeCall{
6262
Name: ccName,
6363
})
6464
}
@@ -67,11 +67,11 @@ func CcCalls(ccNames ...string) []*discovery.ChaincodeCall {
6767
}
6868

6969
// CcInterests creates an array of ChaincodeInterests based of ChaincodeCalls, can be used in AddEndorsersQuery(CcInterests(CcCalls(...)))
70-
func CcInterests(invocationsChains ...[]*discovery.ChaincodeCall) []*discovery.ChaincodeInterest {
71-
var interests []*discovery.ChaincodeInterest
70+
func CcInterests(invocationsChains ...[]*peer.ChaincodeCall) []*peer.ChaincodeInterest {
71+
var interests []*peer.ChaincodeInterest
7272

7373
for _, invocationChain := range invocationsChains {
74-
interests = append(interests, &discovery.ChaincodeInterest{
74+
interests = append(interests, &peer.ChaincodeInterest{
7575
Chaincodes: invocationChain,
7676
})
7777
}

test/integration/pkg/client/common/discovery/discoveryclient_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !prev
12
// +build !prev
23

34
/*
@@ -27,7 +28,7 @@ import (
2728
"github.com/stretchr/testify/assert"
2829
"github.com/stretchr/testify/require"
2930

30-
fabdiscovery "github.com/hyperledger/fabric-protos-go/discovery"
31+
"github.com/hyperledger/fabric-protos-go/peer"
3132
discclient "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/discovery/client"
3233
"github.com/hyperledger/fabric-sdk-go/pkg/context"
3334
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk"
@@ -300,7 +301,7 @@ func TestDiscoveryClientEndorsers(t *testing.T) {
300301
})
301302
}
302303

303-
func testEndorsers(t *testing.T, sdk *fabsdk.FabricSDK, interest *fabdiscovery.ChaincodeInterest, filter discclient.Filter, expectedEndorserGroups ...[]string) {
304+
func testEndorsers(t *testing.T, sdk *fabsdk.FabricSDK, interest *peer.ChaincodeInterest, filter discclient.Filter, expectedEndorserGroups ...[]string) {
304305
ctxProvider := sdk.Context(fabsdk.WithUser(org1User), fabsdk.WithOrg(org1Name))
305306
ctx, err := ctxProvider()
306307
require.NoError(t, err, "error getting channel context")
@@ -403,7 +404,7 @@ func setupOrgContext(t *testing.T) []*integration.OrgContext {
403404
}
404405
}
405406

406-
func sendEndorserQuery(t *testing.T, ctx contextAPI.Client, client discovery.Client, interest *fabdiscovery.ChaincodeInterest, peerConfig fab.PeerConfig) (discclient.ChannelResponse, error) {
407+
func sendEndorserQuery(t *testing.T, ctx contextAPI.Client, client discovery.Client, interest *peer.ChaincodeInterest, peerConfig fab.PeerConfig) (discclient.ChannelResponse, error) {
407408
req, err := discovery.NewRequest().OfChannel(orgChannelID).AddEndorsersQuery(interest)
408409
require.NoError(t, err, "error adding endorsers query")
409410

@@ -463,15 +464,15 @@ func contains(group []string, endorser string) bool {
463464
return false
464465
}
465466

466-
func newCCCall(ccID string, collections ...string) *fabdiscovery.ChaincodeCall {
467-
return &fabdiscovery.ChaincodeCall{
467+
func newCCCall(ccID string, collections ...string) *peer.ChaincodeCall {
468+
return &peer.ChaincodeCall{
468469
Name: ccID,
469470
CollectionNames: collections,
470471
}
471472
}
472473

473-
func newInterest(ccCalls ...*fabdiscovery.ChaincodeCall) *fabdiscovery.ChaincodeInterest {
474-
return &fabdiscovery.ChaincodeInterest{Chaincodes: ccCalls}
474+
func newInterest(ccCalls ...*peer.ChaincodeCall) *peer.ChaincodeInterest {
475+
return &peer.ChaincodeInterest{Chaincodes: ccCalls}
475476
}
476477

477478
func asURLs(t *testing.T, endorsers discclient.Endorsers) []string {

0 commit comments

Comments
 (0)