Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from bstasyszyn/38
Browse files Browse the repository at this point in the history
chore: Update to latest fabric-protos-go
  • Loading branch information
fqutishat authored Nov 28, 2019
2 parents 8fb37ca + f6db2ef commit 95d6e4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
23 changes: 12 additions & 11 deletions bddtests/common_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/DATA-DOG/godog"
"github.com/hyperledger/fabric-protos-go/common"
fabricCommon "github.com/hyperledger/fabric-protos-go/common"
pb "github.com/hyperledger/fabric-protos-go/peer"
"github.com/hyperledger/fabric-sdk-go/pkg/client/channel"
"github.com/hyperledger/fabric-sdk-go/pkg/client/channel/invoke"
"github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt"
Expand Down Expand Up @@ -838,7 +839,7 @@ func (d *CommonSteps) instantiateChaincodeWithOpts(ccType, ccID, ccPath, orgIDs,
}
}

var collConfig []*common.CollectionConfig
var collConfig []*pb.CollectionConfig
if collectionNames != "" {
// Define the private data collection policy config
for _, collName := range strings.Split(collectionNames, ",") {
Expand Down Expand Up @@ -906,7 +907,7 @@ func (d *CommonSteps) upgradeChaincodeWithOpts(ccType, ccID, ccVersion, ccPath,
}
}

var collConfig []*common.CollectionConfig
var collConfig []*pb.CollectionConfig
if collectionNames != "" {
// Define the private data collection policy config
for _, collName := range strings.Split(collectionNames, ",") {
Expand Down Expand Up @@ -994,7 +995,7 @@ func (d *CommonSteps) deployChaincodeToOrg(ccType, ccID, ccPath, orgIDs, channel

argsArray := strings.Split(args, ",")

var collConfig []*common.CollectionConfig
var collConfig []*pb.CollectionConfig
if collectionNames != "" {
// Define the private data collection policy config
for _, collName := range strings.Split(collectionNames, ",") {
Expand Down Expand Up @@ -1082,7 +1083,7 @@ func (d *CommonSteps) defineCollectionConfig(id, collection, policy string, requ
return nil
}

func (d *CommonSteps) newCollectionConfig(channelID string, collName string) (*common.CollectionConfig, error) {
func (d *CommonSteps) newCollectionConfig(channelID string, collName string) (*pb.CollectionConfig, error) {
createCollectionConfig := d.BDDContext.CollectionConfig(collName)
if createCollectionConfig == nil {
return nil, errors.Errorf("no collection config defined for collection [%s]", collName)
Expand All @@ -1093,7 +1094,7 @@ func (d *CommonSteps) newCollectionConfig(channelID string, collName string) (*c
// DefineCollectionConfig defines a new private data collection configuration
func (d *CommonSteps) DefineCollectionConfig(id, name, policy string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64) {
d.BDDContext.DefineCollectionConfig(id,
func(channelID string) (*common.CollectionConfig, error) {
func(channelID string) (*pb.CollectionConfig, error) {
sigPolicy, err := d.newChaincodePolicy(policy, channelID)
if err != nil {
return nil, errors.Wrapf(err, "error creating collection policy for collection [%s]", name)
Expand Down Expand Up @@ -1156,16 +1157,16 @@ func ResolveAllVars(args string) ([]string, error) {
return ResolveAll(vars, strings.Split(args, ","))
}

func newPrivateCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64, policy *common.SignaturePolicyEnvelope) *common.CollectionConfig {
return &common.CollectionConfig{
Payload: &common.CollectionConfig_StaticCollectionConfig{
StaticCollectionConfig: &common.StaticCollectionConfig{
func newPrivateCollectionConfig(collName string, requiredPeerCount, maxPeerCount int32, blocksToLive uint64, policy *common.SignaturePolicyEnvelope) *pb.CollectionConfig {
return &pb.CollectionConfig{
Payload: &pb.CollectionConfig_StaticCollectionConfig{
StaticCollectionConfig: &pb.StaticCollectionConfig{
Name: collName,
RequiredPeerCount: requiredPeerCount,
MaximumPeerCount: maxPeerCount,
BlockToLive: blocksToLive,
MemberOrgsPolicy: &common.CollectionPolicyConfig{
Payload: &common.CollectionPolicyConfig_SignaturePolicy{
MemberOrgsPolicy: &pb.CollectionPolicyConfig{
Payload: &pb.CollectionPolicyConfig_SignaturePolicy{
SignaturePolicy: policy,
},
},
Expand Down
4 changes: 2 additions & 2 deletions bddtests/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"sync"

"github.com/hyperledger/fabric-protos-go/common"
pb "github.com/hyperledger/fabric-protos-go/peer"
"github.com/hyperledger/fabric-sdk-go/pkg/client/channel"
"github.com/hyperledger/fabric-sdk-go/pkg/client/common/selection/staticselection"
"github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt"
Expand All @@ -33,7 +33,7 @@ var ADMIN = "admin"
var USER = "user"

// CollectionConfigCreator creates a collection config for the given channel
type CollectionConfigCreator func(channelID string) (*common.CollectionConfig, error)
type CollectionConfigCreator func(channelID string) (*pb.CollectionConfig, error)

// BDDContext ...
type BDDContext struct {
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ require (
github.com/DATA-DOG/godog v0.7.13
github.com/containerd/continuity v0.0.0-20181003075958-be9bd761db19 // indirect
github.com/fsouza/go-dockerclient v1.3.0
github.com/hyperledger/fabric-protos-go v0.0.0-20190821180310-6b6ac9042dfd
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20190930220855-cea2ffaf627c
github.com/hyperledger/fabric-protos-go v0.0.0-20191121202242-f5500d5e3e85
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20191127214205-648507b21445
github.com/magiconair/properties v1.8.0 // indirect
github.com/mitchellh/mapstructure v1.1.1 // indirect
github.com/pkg/errors v0.8.1
Expand All @@ -18,5 +18,4 @@ require (
github.com/spf13/viper v1.0.2
github.com/stretchr/testify v1.3.0
github.com/tidwall/gjson v1.3.2
google.golang.org/appengine v1.4.0 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ 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-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
github.com/hyperledger/fabric-protos-go v0.0.0-20190821180310-6b6ac9042dfd h1:z0IbaMd4Ry2Cmmxujzy4UDgCUsT/0dOqqoGtOcvDw9Q=
github.com/hyperledger/fabric-protos-go v0.0.0-20190821180310-6b6ac9042dfd/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20190930220855-cea2ffaf627c h1:XxVNT73QNRtWwspRrviiBc9OIxL/+zbY5SHtpTxXfMk=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20190930220855-cea2ffaf627c/go.mod h1:i8yJ9t8i1fGe7opUcq6uESxhruMJNXlc+Rx9ooBZsYg=
github.com/hyperledger/fabric-protos-go v0.0.0-20191121202242-f5500d5e3e85 h1:bNgEcCg5NVRWs/T+VUEfhgh5Olx/N4VB+0+ybW+oSuA=
github.com/hyperledger/fabric-protos-go v0.0.0-20191121202242-f5500d5e3e85/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20191127214205-648507b21445 h1:AjIE+/GLYv1+FJi4SToHN03xT4doENlO5/Kqi1HtEA4=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20191127214205-648507b21445/go.mod h1:5ehPzmNekl6dCIu1aFljDY7ML/dzNZRZE7CCHnmhtp8=
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs=
github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
Expand Down

0 comments on commit 95d6e4c

Please sign in to comment.