Skip to content

Commit 42bf1e0

Browse files
authored
move integration/channel_partipation to nwo,so that you can use channel_participation inside the nwo package. Otherwise, these packages will link to each other. (hyperledger#5245)
Signed-off-by: Fedor Partanskiy <[email protected]>
1 parent 820f0b8 commit 42bf1e0

36 files changed

+285
-320
lines changed

integration/configtx/configtx_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
docker "github.com/fsouza/go-dockerclient"
1818
"github.com/hyperledger/fabric-config/configtx"
1919
"github.com/hyperledger/fabric-protos-go-apiv2/common"
20-
"github.com/hyperledger/fabric/integration/channelparticipation"
2120
"github.com/hyperledger/fabric/integration/nwo"
2221
"github.com/hyperledger/fabric/integration/ordererclient"
2322
. "github.com/hyperledger/fabric/internal/test"
@@ -83,7 +82,7 @@ var _ = Describe("ConfigTx", func() {
8382
orderer := network.Orderer("orderer")
8483

8584
By("joining all peers to the channel")
86-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
85+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
8786

8887
By("getting the current channel config")
8988
org2peer0 := network.Peer("Org2", "peer0")

integration/devmode/devmode_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"time"
1616

1717
docker "github.com/fsouza/go-dockerclient"
18-
"github.com/hyperledger/fabric/integration/channelparticipation"
1918
"github.com/hyperledger/fabric/integration/nwo"
2019
"github.com/hyperledger/fabric/integration/nwo/commands"
2120
. "github.com/onsi/ginkgo/v2"
@@ -100,7 +99,7 @@ var _ = Describe("Devmode", func() {
10099
orderer := network.Orderer("orderer")
101100

102101
By("setting up the channel")
103-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
102+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
104103

105104
By("enabling V2_0 application capabilities")
106105
nwo.EnableCapabilities(network, channelName, "Application", "V2_0", orderer, org1peer0)

integration/discovery/discovery_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/hyperledger/fabric-protos-go-apiv2/discovery"
2020
pm "github.com/hyperledger/fabric-protos-go-apiv2/msp"
2121
"github.com/hyperledger/fabric/common/policydsl"
22-
"github.com/hyperledger/fabric/integration/channelparticipation"
2322
"github.com/hyperledger/fabric/integration/nwo"
2423
"github.com/hyperledger/fabric/integration/nwo/commands"
2524
. "github.com/hyperledger/fabric/internal/test"
@@ -100,7 +99,7 @@ var _ = Describe("DiscoveryService", func() {
10099
peerProcesses = append(peerProcesses, peerProcess)
101100

102101
orderer = network.Orderer("orderer")
103-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
102+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
104103

105104
org1Peer0 = network.Peer("Org1", "peer0")
106105
org2Peer0 = network.Peer("Org2", "peer0")
@@ -226,7 +225,7 @@ var _ = Describe("DiscoveryService", func() {
226225
peerProcesses = append(peerProcesses, peerProcess)
227226

228227
orderer = network.Orderer("orderer")
229-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
228+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
230229

231230
org1Peer0 = network.Peer("Org1", "peer0")
232231
org2Peer0 = network.Peer("Org2", "peer0")

integration/e2e/acl_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/hyperledger/fabric-protos-go-apiv2/common"
1818
pb "github.com/hyperledger/fabric-protos-go-apiv2/peer"
1919
"github.com/hyperledger/fabric/core/aclmgmt/resources"
20-
"github.com/hyperledger/fabric/integration/channelparticipation"
2120
"github.com/hyperledger/fabric/integration/nwo"
2221
"github.com/hyperledger/fabric/integration/nwo/commands"
2322
"github.com/hyperledger/fabric/protoutil"
@@ -69,7 +68,7 @@ var _ = Describe("EndToEndACL", func() {
6968
org1Peer0 = network.Peer("Org1", "peer0")
7069
org2Peer0 = network.Peer("Org2", "peer0")
7170

72-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
71+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
7372
})
7473

7574
AfterEach(func() {

integration/e2e/chaincode_server_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717

1818
"github.com/hyperledger/fabric/common/crypto/tlsgen"
1919
"github.com/hyperledger/fabric/core/container/externalbuilder"
20-
"github.com/hyperledger/fabric/integration/channelparticipation"
2120
"github.com/hyperledger/fabric/integration/nwo"
2221
. "github.com/onsi/ginkgo/v2"
2322
. "github.com/onsi/gomega"
@@ -68,7 +67,7 @@ var _ = Describe("ChaincodeAsExternalServer", func() {
6867
// Setup the network
6968
ordererRunner, ordererProcess, peerProcess = network.StartSingleOrdererNetwork("orderer")
7069

71-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", network.Orderer("orderer"), ordererRunner)
70+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", network.Orderer("orderer"), ordererRunner)
7271

7372
nwo.EnableCapabilities(
7473
network,

integration/e2e/e2e_test.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
docker "github.com/fsouza/go-dockerclient"
2727
"github.com/hyperledger/fabric-lib-go/healthz"
2828
"github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft"
29-
"github.com/hyperledger/fabric/integration/channelparticipation"
3029
"github.com/hyperledger/fabric/integration/nwo"
3130
"github.com/hyperledger/fabric/integration/nwo/commands"
3231
"github.com/hyperledger/fabric/integration/nwo/fabricconfig"
@@ -168,13 +167,13 @@ var _ = Describe("EndToEnd", func() {
168167
})
169168
Expect(err).NotTo(HaveOccurred())
170169
Eventually(sess).Should(gexec.Exit(0))
171-
var channelList channelparticipation.ChannelList
170+
var channelList nwo.ChannelList
172171
err = json.Unmarshal(sess.Out.Contents(), &channelList)
173172
Expect(err).NotTo(HaveOccurred())
174-
Expect(channelList).To(Equal(channelparticipation.ChannelList{}))
173+
Expect(channelList).To(Equal(nwo.ChannelList{}))
175174

176175
By("setting up the channel")
177-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
176+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
178177

179178
By("listing channels with osnadmin")
180179
sess, err = network.Osnadmin(commands.ChannelList{
@@ -187,8 +186,8 @@ var _ = Describe("EndToEnd", func() {
187186
Eventually(sess).Should(gexec.Exit(0))
188187
err = json.Unmarshal(sess.Out.Contents(), &channelList)
189188
Expect(err).NotTo(HaveOccurred())
190-
Expect(channelList).To(Equal(channelparticipation.ChannelList{
191-
Channels: []channelparticipation.ChannelInfoShort{{
189+
Expect(channelList).To(Equal(nwo.ChannelList{
190+
Channels: []nwo.ChannelInfoShort{{
192191
Name: "testchannel",
193192
URL: "/participation/v1/channels/testchannel",
194193
}},
@@ -242,7 +241,7 @@ var _ = Describe("EndToEnd", func() {
242241
CheckOrdererStatsdMetrics("ordererorg_orderer", metricsReader, 2*metricsWriteInterval)
243242

244243
By("setting up another channel from a the same profile")
245-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "another-testchannel", orderer, ordererRunner)
244+
nwo.JoinOrdererJoinPeersAppChannel(network, "another-testchannel", orderer, ordererRunner)
246245

247246
By("listing channels with osnadmin")
248247
sess, err = network.Osnadmin(commands.ChannelList{
@@ -258,8 +257,8 @@ var _ = Describe("EndToEnd", func() {
258257
sort.Slice(channelList.Channels, func(i, j int) bool {
259258
return channelList.Channels[i].Name < channelList.Channels[j].Name
260259
})
261-
Expect(channelList).To(Equal(channelparticipation.ChannelList{
262-
Channels: []channelparticipation.ChannelInfoShort{
260+
Expect(channelList).To(Equal(nwo.ChannelList{
261+
Channels: []nwo.ChannelInfoShort{
263262
{
264263
Name: "another-testchannel",
265264
URL: "/participation/v1/channels/another-testchannel",
@@ -319,10 +318,10 @@ var _ = Describe("EndToEnd", func() {
319318
orderer := network.Orderer("orderer")
320319

321320
By("setting up the channel")
322-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
321+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
323322

324-
cl := channelparticipation.List(network, orderer)
325-
channelparticipation.ChannelListMatcher(cl, []string{"testchannel"})
323+
cl := nwo.List(network, orderer)
324+
nwo.ChannelListMatcher(cl, []string{"testchannel"})
326325

327326
nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))
328327

@@ -446,18 +445,18 @@ var _ = Describe("EndToEnd", func() {
446445
orderer := network.Orderer("orderer")
447446

448447
By("Create first channel and deploy the chaincode")
449-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
448+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
450449

451450
nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))
452451
nwo.DeployChaincode(network, "testchannel", orderer, chaincode)
453452
peer := network.Peer("Org1", "peer0")
454453
RunQueryInvokeQuery(network, orderer, peer, "testchannel")
455454

456455
By("Create second channel and deploy chaincode")
457-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel2", orderer, ordererRunner)
456+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel2", orderer, ordererRunner)
458457

459-
cl := channelparticipation.List(network, orderer)
460-
channelparticipation.ChannelListMatcher(cl, []string{"testchannel", "testchannel2"})
458+
cl := nwo.List(network, orderer)
459+
nwo.ChannelListMatcher(cl, []string{"testchannel", "testchannel2"})
461460

462461
nwo.EnableCapabilities(network, "testchannel2", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))
463462
peers := network.PeersWithChannel("testchannel2")
@@ -532,7 +531,7 @@ var _ = Describe("EndToEnd", func() {
532531

533532
It("creates and updates channel", func() {
534533
orderer := network.Orderer("orderer")
535-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
534+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
536535

537536
// The below call waits for the config update to commit on the peer, so
538537
// it will fail if the orderer addresses are wrong.
@@ -568,7 +567,7 @@ var _ = Describe("EndToEnd", func() {
568567
orderer := network.Orderer("orderer")
569568

570569
By("creating and joining channels")
571-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
570+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
572571

573572
By("enabling new lifecycle capabilities")
574573
nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))
@@ -658,7 +657,7 @@ var _ = Describe("EndToEnd", func() {
658657
orderer := network.Orderer("orderer")
659658

660659
By("creating and joining channels")
661-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
660+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
662661

663662
By("enabling new lifecycle capabilities")
664663
nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))

integration/e2e/filter_proposal_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/hyperledger/fabric-protos-go-apiv2/common"
1919
"github.com/hyperledger/fabric-protos-go-apiv2/gateway"
2020
"github.com/hyperledger/fabric-protos-go-apiv2/peer"
21-
"github.com/hyperledger/fabric/integration/channelparticipation"
2221
"github.com/hyperledger/fabric/integration/nwo"
2322
"github.com/hyperledger/fabric/protoutil"
2423
. "github.com/onsi/ginkgo/v2"
@@ -92,7 +91,7 @@ var _ = Describe("FilterProposalTimeWindow", func() {
9291
orderer := network.Orderer("orderer")
9392

9493
By("setting up the channel")
95-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
94+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
9695

9796
By("enabling new lifecycle capabilities")
9897
nwo.EnableCapabilities(network, "testchannel", "Application", "V2_5", orderer, network.Peer("Org1", "peer0"), network.Peer("Org2", "peer0"))

integration/e2e/write_batch_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"syscall"
1414

1515
docker "github.com/fsouza/go-dockerclient"
16-
"github.com/hyperledger/fabric/integration/channelparticipation"
1716
"github.com/hyperledger/fabric/integration/nwo"
1817
"github.com/hyperledger/fabric/integration/nwo/commands"
1918
. "github.com/onsi/ginkgo/v2"
@@ -77,7 +76,7 @@ var _ = Describe("Network", func() {
7776

7877
It("deploys and executes experiment bench", func() {
7978
orderer := network.Orderer("orderer")
80-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
79+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
8180
peer := network.Peer("Org1", "peer0")
8281

8382
chaincode := nwo.Chaincode{
@@ -160,7 +159,7 @@ var _ = Describe("Network", func() {
160159

161160
It("put private data for error", func() {
162161
orderer := network.Orderer("orderer")
163-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
162+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
164163
peer := network.Peer("Org1", "peer0")
165164

166165
chaincode := nwo.Chaincode{
@@ -235,7 +234,7 @@ var _ = Describe("Network", func() {
235234

236235
It("deploys and executes experiment bench", func() {
237236
orderer := network.Orderer("orderer")
238-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
237+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
239238
peer := network.Peer("Org1", "peer0")
240239

241240
chaincode := nwo.Chaincode{

integration/gateway/endorsing_orgs_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
docker "github.com/fsouza/go-dockerclient"
1616
"github.com/hyperledger/fabric-protos-go-apiv2/gateway"
1717
"github.com/hyperledger/fabric-protos-go-apiv2/peer"
18-
"github.com/hyperledger/fabric/integration/channelparticipation"
1918
"github.com/hyperledger/fabric/integration/nwo"
2019
. "github.com/hyperledger/fabric/internal/test"
2120
"github.com/hyperledger/fabric/protoutil"
@@ -55,7 +54,7 @@ var _ = Describe("GatewayService with endorsing orgs", func() {
5554
ordererRunner, ordererProcess, peerProcess = network.StartSingleOrdererNetwork("orderer")
5655

5756
orderer = network.Orderer("orderer")
58-
channelparticipation.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
57+
nwo.JoinOrdererJoinPeersAppChannel(network, "testchannel", orderer, ordererRunner)
5958

6059
network.VerifyMembership(
6160
network.PeersWithChannel("testchannel"),

integration/gateway/gateway_bft_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/hyperledger/fabric-protos-go-apiv2/common"
1919
"github.com/hyperledger/fabric-protos-go-apiv2/gateway"
2020
"github.com/hyperledger/fabric-protos-go-apiv2/peer"
21-
"github.com/hyperledger/fabric/integration/channelparticipation"
2221
"github.com/hyperledger/fabric/integration/nwo"
2322
"github.com/hyperledger/fabric/integration/nwo/commands"
2423
. "github.com/onsi/ginkgo/v2"
@@ -374,7 +373,7 @@ func joinChannel(network *nwo.Network, channel string) {
374373
err = proto.Unmarshal(genesisBlockBytes, genesisBlock)
375374
Expect(err).NotTo(HaveOccurred())
376375

377-
expectedChannelInfoPT := channelparticipation.ChannelInfo{
376+
expectedChannelInfoPT := nwo.ChannelInfo{
378377
Name: channel,
379378
URL: "/participation/v1/channels/" + channel,
380379
Status: "active",
@@ -384,8 +383,8 @@ func joinChannel(network *nwo.Network, channel string) {
384383

385384
for _, o := range network.Orderers {
386385
By("joining " + o.Name + " to channel as a consenter")
387-
channelparticipation.Join(network, o, channel, genesisBlock, expectedChannelInfoPT)
388-
channelInfo := channelparticipation.ListOne(network, o, channel)
386+
nwo.Join(network, o, channel, genesisBlock, expectedChannelInfoPT)
387+
channelInfo := nwo.ListOne(network, o, channel)
389388
Expect(channelInfo).To(Equal(expectedChannelInfoPT))
390389
}
391390
}

0 commit comments

Comments
 (0)