Skip to content

Commit

Permalink
[FAB-17577] Rename config package to configtx
Browse files Browse the repository at this point in the history
* And associated integration test

Signed-off-by: Danny Cao <dcao@us.ibm.com>
  • Loading branch information
caod123 authored and sykesm committed Apr 16, 2020
1 parent eff2f93 commit d0192fd
Show file tree
Hide file tree
Showing 24 changed files with 200 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"encoding/json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"crypto"
Expand All @@ -20,7 +20,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/integration/nwo"
"github.com/hyperledger/fabric/integration/nwo/commands"
"github.com/hyperledger/fabric/pkg/config"
"github.com/hyperledger/fabric/pkg/configtx"
"github.com/tedsuo/ifrit"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -76,10 +76,10 @@ var _ = Describe("Config", func() {
org1peer0 := network.Peer("Org1", "peer0")

By("setting up the channel")
channel := config.Channel{
channel := configtx.Channel{
Consortium: "SampleConsortium",
Application: config.Application{
Organizations: []config.Organization{
Application: configtx.Application{
Organizations: []configtx.Organization{
{
Name: "Org1",
},
Expand All @@ -89,33 +89,33 @@ var _ = Describe("Config", func() {
},
Capabilities: []string{"V1_3"},
ACLs: map[string]string{"event/Block": "/Channel/Application/Readers"},
Policies: map[string]config.Policy{
config.ReadersPolicyKey: {
Type: config.ImplicitMetaPolicyType,
Policies: map[string]configtx.Policy{
configtx.ReadersPolicyKey: {
Type: configtx.ImplicitMetaPolicyType,
Rule: "ANY Readers",
},
config.WritersPolicyKey: {
Type: config.ImplicitMetaPolicyType,
configtx.WritersPolicyKey: {
Type: configtx.ImplicitMetaPolicyType,
Rule: "ANY Writers",
},
config.AdminsPolicyKey: {
Type: config.ImplicitMetaPolicyType,
configtx.AdminsPolicyKey: {
Type: configtx.ImplicitMetaPolicyType,
Rule: "MAJORITY Admins",
},
config.EndorsementPolicyKey: {
Type: config.ImplicitMetaPolicyType,
configtx.EndorsementPolicyKey: {
Type: configtx.ImplicitMetaPolicyType,
Rule: "MAJORITY Endorsement",
},
config.LifecycleEndorsementPolicyKey: {
Type: config.ImplicitMetaPolicyType,
configtx.LifecycleEndorsementPolicyKey: {
Type: configtx.ImplicitMetaPolicyType,
Rule: "MAJORITY Endorsement",
},
},
},
}

channelID := "testchannel"
envelope, err := config.NewCreateChannelTx(channel, channelID)
envelope, err := configtx.NewCreateChannelTx(channel, channelID)
Expect(err).NotTo(HaveOccurred())
envBytes, err := proto.Marshal(envelope)
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -145,19 +145,19 @@ var _ = Describe("Config", func() {
By("getting the current channel config")
channelConfig := nwo.GetConfig(network, peer, orderer, "testchannel")

c := config.New(channelConfig)
c := configtx.New(channelConfig)

By("adding the anchor peer for " + peer.Organization)
host, port := peerHostPort(network, peer)
err = c.AddAnchorPeer(peer.Organization, config.Address{Host: host, Port: port})
err = c.AddAnchorPeer(peer.Organization, configtx.Address{Host: host, Port: port})
Expect(err).NotTo(HaveOccurred())

By("computing the config update")
configUpdate, err := c.ComputeUpdate("testchannel")
Expect(err).NotTo(HaveOccurred())

By("creating a detached signature")
signingIdentity := config.SigningIdentity{
signingIdentity := configtx.SigningIdentity{
Certificate: parsePeerX509Certificate(network, peer),
PrivateKey: parsePeerPrivateKey(network, peer, "Admin"),
MSPID: network.Organization(peer.Organization).MSPID,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/application.go → pkg/configtx/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config.go → pkg/configtx/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

// EXPERIMENTAL - Package config allows the creation, retrieval, and modification of channel configtx.
package config
// Package configtx allows the creation, retrieval, and modification of channel configtx.
package configtx

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go → pkg/configtx/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/consortiums.go → pkg/configtx/consortiums.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/constants.go → pkg/configtx/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package config
package configtx

import "math"

Expand Down
Loading

0 comments on commit d0192fd

Please sign in to comment.